Generated by DeepSeek V3.2| StarOffice Basic | |
|---|---|
| Name | StarOffice Basic |
| Paradigm | Procedural programming, Event-driven programming |
| Developer | StarDivision |
| Influenced by | Microsoft Visual Basic for Applications |
| Operating system | Solaris (operating system), Linux, Microsoft Windows |
StarOffice Basic. It is a dialect of the BASIC programming language integrated into the StarOffice office suite and its successor, OpenOffice.org. Designed primarily for task automation and extending application functionality, it provides direct access to the suite's document models and components through a comprehensive Application programming interface. The language shares conceptual similarities with Microsoft Visual Basic for Applications but is implemented within a cross-platform framework.
As the built-in macro language for StarDivision's office suite, it enables users to automate repetitive tasks, create custom functions, and build complex dialog-driven applications. The language interpreter is embedded within the suite's core, allowing scripts to manipulate Writer (word processor), Calc (spreadsheet), and Impress (presentation program) documents. Following the acquisition of StarDivision by Sun Microsystems, the language became a foundational part of the open-source OpenOffice.org project. Its architecture is built around the suite's UNO (software) component model, which facilitates interaction with all application features.
Key capabilities include direct access to document content, the ability to create and manage custom dialog boxes via an integrated dialog editor, and robust file input/output operations. It supports a wide range of data types, including arrays, and can leverage the full StarOffice API for controlling menus, toolbars, and event handlers. The language includes debugging tools such as breakpoints and step execution within the Integrated development environment of the office suite. Furthermore, scripts can call external libraries and interact with other technologies supported by the platform, enhancing its extensibility.
The syntax is largely reminiscent of classic BASIC, utilizing line-oriented statements, explicit variable declaration with the `Dim` keyword, and familiar control structures like `If...Then...Else` and `For...Next` loops. Subroutines and functions are defined using `Sub` and `Function` blocks. A distinctive element is its deep integration with the UNO (software) interface, requiring objects to be declared with specific types from the StarOffice API. Error handling is managed through `On Error` statements, and the language includes a suite of built-in functions for mathematical, string, and date manipulation.
Macros are stored directly within OpenDocument files or in a user's central script repository, allowing for portable automation. The language runtime has complete access to the document object model, enabling scripts to format text in Writer (word processor), perform calculations in Calc (spreadsheet), or control slide transitions in Impress (presentation program). Event-driven programming is supported, allowing scripts to be triggered by user actions such as clicking a button or opening a document. This tight coupling is facilitated by the underlying UNO (software) bridge, which acts as a middleware layer.
While syntactically similar to Microsoft Visual Basic for Applications, it is a separate implementation designed for portability across operating systems like Solaris (operating system), Linux, and Microsoft Windows. Unlike the VBScript engine used in some applications, it is a compiled bytecode language executed within the office suite's runtime. It lacks some advanced object-oriented features found in Visual Basic .NET but offers comparable office automation power through its native UNO (software) bindings. Its cross-platform nature stands in contrast to the Windows API-centric design of many contemporary BASIC variants.
The language originated in the mid-1990s as part of the proprietary StarOffice suite developed by the German company StarDivision. Its design was influenced by the need for a macro language to compete with the automation capabilities of Microsoft Office. After Sun Microsystems acquired StarDivision in 1999, the suite and its macro language were released as open-source, forming the basis of OpenOffice.org. Subsequent development was managed by the OpenOffice.org community and later by The Document Foundation for LibreOffice, which continued to evolve its own compatible but diverged LibreOffice Basic implementation.
Category:BASIC programming language family Category:StarOffice Category:Macro programming languages