StarOffice Basic

StarOffice Basic

StarOffice Basic (also known as StarBasic and OOoBasic) is a dialect of BASIC that is included with the OpenOffice.org and StarOffice office suites.

Contents

Example

Although StarBasic itself is similar to other dialects of Basic, such as Microsoft's 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 (see the Talk page), the example shows the fundamental methods for accessing each paragraph in a text document, sequentially.

 
 Sub ParaCount
 '
 ' Count number of paragraphs in a text document
 '
   Dim Doc As Object, Enum As Object, Count As Long
   Doc = ThisComponent
 ' Is this a text document?
   If Not Doc.SupportsService("com.sun.star.text.TextDocument") Then
     MsgBox "This macro must be run from a text document", 64, "Error"
     Exit Sub
   End If
   Count = 0
 ' Examine each component - paragraph or table?
   Enum = Doc.Text.CreateEnumeration
   While Enum.HasMoreElements
     TextEl = Enum.NextElement
 ' Is the component a paragraph?
     If TextEl.SupportsService("com.sun.star.text.Paragraph") Then 
       Count = Count + 1
     End If
   Wend
 'Display result
   MsgBox Count, 0, "Paragraph Count"
 End Sub

See also

  • Comparison of office suites

External links

BASIC Macros

StarOffice/OpenOffice.org API


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • StarOffice Basic — (aussi connu sous le nom de StarBasic) est un dialecte du langage de programmation Basic qui est inclus dans les suites bureautiques OpenOffice.org et StarOffice. Il supporte l Unicode. Sommaire 1 Exemple 2 Liens externes …   Wikipédia en Français

  • StarOffice Basic — (auch bekannt unter der Bezeichnung StarBasic und OOoBasic) ist ein BASIC Dialekt, der in die Office Suiten OpenOffice.org und Oracle Open Office und dem darauf basierenden IBM Lotus Symphony integriert ist. Obwohl StarBasic selbst eine… …   Deutsch Wikipedia

  • StarOffice — Writer 8 running on Solaris Original autho …   Wikipedia

  • Basic (langage) — BASIC Pour les articles homonymes, voir Basic. {{{image}}}   Sigles d une seule lettre   Sigles de deux lettres   Sigles de trois lettres …   Wikipédia en Français

  • BASIC-256 — с …   Википедия

  • BASIC — This article is about the programming language. For the think tank, see British American Security Information Council. For the group of countries, see BASIC countries. For other uses, see Basic (disambiguation). BASIC Screenshot of Atari BASIC,… …   Wikipedia

  • Staroffice — Entwickler: Sun Microsystems (bis 1999: Star Division) Aktuelle Version: 9 (18. November 2008) Betriebssystem: Windows …   Deutsch Wikipedia

  • StarOffice — StarOffice …   Deutsch Wikipedia

  • Langage BASIC — BASIC Pour les articles homonymes, voir Basic. {{{image}}}   Sigles d une seule lettre   Sigles de deux lettres   Sigles de trois lettres …   Wikipédia en Français

  • Dartmouth BASIC — BASIC Paradigm(s) imperative Appeared in 1964 Designed by John Kemeny, Thomas Kurtz Influenced by FORTRAN, ALGOL Influenced Cf …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”