OpenOffice Basic

Last updated

OpenOffice Basic (formerly known as StarOffice Basic or StarBasic or OOoBasic) is a dialect of the programming language BASIC that originated with the StarOffice office suite and spread through OpenOffice.org and derivatives such as Apache OpenOffice and LibreOffice (where it is known as LibreOffice Basic). The language is a domain-specific programming language which specifically serves the OpenOffice application suite.

Contents

Example

Although OpenOffice Basic is similar to other dialects of BASIC, such as Microsoft's Visual Basic for Applications (VBA), the application programming interface (API) is very different, as the example below of a macro illustrates. While there is a much easier way to obtain the "paragraph count" document property, the example shows the fundamental methods for accessing each paragraph in a text document, sequentially.

SubParaCount'' Count number of paragraphs in a text document'DimDocAsObject,EnumAsObject,TextElAsObject,CountAsLongDoc=ThisComponent' Is this a text document?IfNotDoc.SupportsService("com.sun.star.text.TextDocument")ThenMsgBox"This macro must be run from a text document",64,"Error"ExitSubEndIfCount=0' Examine each component - paragraph or table?Enum= Doc.Text.CreateEnumerationWhileEnum.HasMoreElementsTextEl=Enum.NextElement' Is the component a paragraph?IfTextEl.SupportsService("com.sun.star.text.Paragraph")ThenCount=Count+1EndIfWend'Display resultMsgBoxCount,0,"Paragraph Count"EndSub

See also

Further reading

Related Research Articles

<span class="mw-page-title-main">Macro (computer science)</span> Rule for substituting a set input with a set output

In computer programming, a macro is a rule or pattern that specifies how a certain input should be mapped to a replacement output. Applying a macro to an input is known as macro expansion. The input and output may be a sequence of lexical tokens or characters, or a syntax tree. Character macros are supported in software applications to make it easy to invoke common command sequences. Token and tree macros are supported in some programming languages to enable code reuse or to extend the language, sometimes for domain-specific languages.

The Rich Text Format is a proprietary document file format with published specification developed by Microsoft Corporation from 1987 until 2008 for cross-platform document interchange with Microsoft products. Prior to 2008, Microsoft published updated specifications for RTF with major revisions of Microsoft Word and Office versions.

VBScript is a deprecated Active Scripting language developed by Microsoft that is modeled on Visual Basic. It allows Microsoft Windows system administrators to generate powerful tools for managing computers without error handling and with subroutines and other advanced programming constructs. It can give the user complete control over many aspects of their computing environment.

Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language Visual Basic 6.0 built into most desktop Microsoft Office applications. Although based on pre-.NET Visual Basic, which is no longer supported or updated by Microsoft, the VBA implementation in Office continues to be updated to support new Office features. VBA is used for professional and end-user development due to its perceived ease-of-use, Office's vast installed userbase, and extensive legacy in business.

<span class="mw-page-title-main">WordPerfect</span> Word processing application

WordPerfect (WP) is a word processing application, now owned by Alludo, with a long history on multiple personal computer platforms. At the height of its popularity in the 1980s and early 1990s, it was the dominant player in the word processor market, displacing the prior market leader WordStar.

AppleScript is a scripting language created by Apple Inc. that facilitates automated control over scriptable Mac applications. First introduced in System 7, it is currently included in all versions of macOS as part of a package of system automation tools. The term "AppleScript" may refer to the language itself, to an individual script written in the language, or, informally, to the macOS Open Scripting Architecture that underlies the language.

<span class="mw-page-title-main">Visual Basic (.NET)</span> Object-oriented computer programming language

Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language, the last version of which was Visual Basic 6.0. Although the ".NET" portion of the name was dropped in 2005, this article uses "Visual Basic [.NET]" to refer to all Visual Basic languages released since 2002, in order to distinguish between them and the classic Visual Basic. Along with C# and F#, it is one of the three main languages targeting the .NET ecosystem. Microsoft updated its VB language strategy on 6 February 2023, stating that VB is a stable language now and Microsoft will keep maintaining it.

<span class="mw-page-title-main">Windows Script Host</span> Automation technology for Windows

The Microsoft Windows Script Host (WSH) is an automation technology for Microsoft Windows operating systems that provides scripting abilities comparable to batch files, but with a wider range of supported features. This tool was first provided on Windows 95 after Build 950a on the installation discs as an optional installation configurable and installable by means of the Control Panel, and then a standard component of Windows 98 and subsequent and Windows NT 4.0 Build 1381 and by means of Service Pack 4. The WSH is also a means of automation for Internet Explorer via the installed WSH engines from IE Version 3.0 onwards; at this time VBScript became means of automation for Microsoft Outlook 97. The WSH is also an optional install provided with a VBScript and JScript engine for Windows CE 3.0 and following and some third-party engines including Rexx and other forms of Basic are also available.

<span class="mw-page-title-main">Universal Network Objects</span>

Universal Network Objects (UNO) is the component model used in the OpenOffice.org and LibreOffice computer software application suites. It is interface-based and designed to offer interoperability between different programming languages, object models and machine architectures, on a single machine, within a LAN or over the Internet.

OpenOffice or open office may refer to:

<span class="mw-page-title-main">NeoOffice</span> macOS office suite

NeoOffice is an office suite for the macOS operating system developed by Planamesa Inc. It is a commercial fork of the free and open source LibreOffice office suite, including a word processor, spreadsheet, presentation program and graphics program, it adds some features not present in the macOS versions of LibreOffice and Apache OpenOffice. The last few versions were based on LibreOffice 4.4, which was released mid-2014.

<span class="mw-page-title-main">AutoIt</span>

AutoIt is a freeware programming language for Microsoft Windows. In its earliest release, it was primarily intended to create automation scripts for Microsoft Windows programs but has since grown to include enhancements in both programming language design and overall functionality.

This article describes the technical specifications of the OpenDocument office document standard, as developed by the OASIS industry consortium. A variety of organizations developed the standard publicly and make it publicly accessible, meaning it can be implemented by anyone without restriction. The OpenDocument format aims to provide an open alternative to proprietary document formats.

In computer programming, an enumerated type is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type. The enumerator names are usually identifiers that behave as constants in the language. An enumerated type can be seen as a degenerate tagged union of unit type. A variable that has been declared as having an enumerated type can be assigned any of the enumerators as a value. In other words, an enumerated type has values that are different from each other, and that can be compared and assigned, but are not specified by the programmer as having any particular concrete representation in the computer's memory; compilers and interpreters can represent them arbitrarily.

<span class="mw-page-title-main">Visual Basic (classic)</span> Microsofts programming language based on BASIC and COM

Visual Basic (VB) before .NET, sometimes referred to as Classic Visual Basic, is a third-generation programming language, based on BASIC, and an integrated development environment (IDE), from Microsoft for Windows known for supporting rapid application development (RAD) of graphical user interface (GUI) applications, event-driven programming and both consumption and development of components via the Component Object Model (COM) technology.

<span class="mw-page-title-main">BlackBox Component Builder</span> Software development tool

BlackBox Component Builder is an integrated development environment (IDE) optimized for component-based software development developed by a small spin-off company, Oberon microsystems AG, of ETH Zurich in Switzerland. The IDE consists of development tools, a library of reusable components, a framework that simplifies developing robust custom components and applications, and a run-time environment for components.

<span class="mw-page-title-main">History of Microsoft Word</span>

The first version of Microsoft Word was developed by Charles Simonyi and Richard Brodie, former Xerox programmers hired by Bill Gates and Paul Allen in 1981. Both programmers worked on Xerox Bravo, the first WYSIWYG word processor. The first Word version, Word 1.0, was released in October 1983 for Xenix and MS-DOS; it was followed by four very similar versions that were not very successful. The first Windows version was released in 1989, with a slightly improved interface. When Windows 3.0 was released in 1990, Word became a huge commercial success. Word for Windows 1.0 was followed by Word 2.0 in 1991 and Word 6.0 in 1993. Then it was renamed to Word 95 and Word 97, Word 2000 and Word for Office XP. With the release of Word 2003, the numbering was again year-based. Since then, Windows versions include Word 2007, Word 2010, Word 2013, Word 2016, and most recently, Word for Office 365.

<span class="mw-page-title-main">LibreOffice</span> Free and open-source office software suite

LibreOffice is a free and open-source office productivity software suite, a project of The Document Foundation (TDF). It was forked in 2010 from OpenOffice.org, an open-sourced version of the earlier StarOffice. It consists of programs for word processing; creating and editing spreadsheets, slideshows, diagrams, and drawings; working with databases; and composing mathematical formulae. It is available in 115 languages. TDF does not provide support for LibreOffice, but enterprise-focused editions are available from companies in the ecosystem.

OnlyOffice, stylized as ONLYOFFICE, is a free software office suite and ecosystem of collaborative applications. It consists of online editors for text documents, spreadsheets, presentations, forms and PDFs, and the room-based collaborative platform.