Content deleted Content added
David Gerard (talk | contribs) m clean up, replaced: OpenOffice → OpenOffice.org using AWB |
m →External links: fix LibreOffice Basic Help link |
||
(40 intermediate revisions by 25 users not shown) | |||
Line 1:
{{Short description|Programming language}}
{{no footnotes|date=December 2013}}
'''OpenOffice Basic''' (formerly known as StarOffice Basic or '''StarBasic''' or '''OOoBasic''') is a dialect of the [[programming language]] [[BASIC]] that
== Example ==
Although
▲<syntaxhighlight lang="oobas">
Sub ParaCount
'
' Count number of paragraphs in a text document
'
Dim Doc As Object, Enum As Object, TextEl 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
</syntaxhighlight>
Line 37:
== Further reading ==
* {{Cite book|first=James|last=Steinberg|title=Open Office Basic: An Introduction|
== External links ==
* [http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide OpenOffice.org BASIC Programming Guide] wiki▼
* [https://help.libreoffice.org/latest/en-US/text/sbasic/shared/main0601.html LibreOffice Basic Help]
* [https://www.manfridayit.co.uk/blog/coding-vba-tips-snippets/using-vb-net-to-update-open-office-calc-spreadsheet/ Automating Open Office in VB.NET]
▲*[http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide OpenOffice.org BASIC Programming Guide] wiki
{{OpenOffice}}
Line 57 ⟶ 49:
[[Category:Articles with example BASIC code]]
[[Category:BASIC programming language family]]
[[Category:OpenOffice|Basic]]
[[Category:LibreOffice|Basic]]
|