OpenOffice Basic

OpenOffice Basic (formalisht i njohur si StarOffice Basic ose StarBasic or OOoBasic) është një dialekt i gjuhës programuese BASIC që filloi me paketën office StarOffice dhe u përhap nëpërmjet OpenOffice.org dhe derivateve si LibreOffice (ku njihet si LibreOffice Basic).

Shëmbull

Edhe pse vetë OpenOffice Basic është e ngjashme me dialektet e tjera të BASIC, si Visual Basic for Applications (VBA) nga Microsoft, API (interface application programming) është shumë e ndryshme, siç ilustron më poshtë një makro. Ndërsa ekziston një mënyrë shumë më e lehtë për të marrë numrin e paragrafit të pronës së dokumentit, shembulli tregon metodat themelore për të hyrë në çdo paragraf në një dokument teksti, në mënyrë sekuenciale.

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


Lixim të mëtejshëm

  • Steinberg, James (2012). Open Office Basic: An Introduction. CreateSpace Independent Publishing Platform. ISBN 978-1481270939. {{cite book}}: Mungon ose është bosh parametri |language= (Ndihmë!)

Ndërlidhje të jashtme

BASIC Macros
OpenOffice.org API
LibreOffice API

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.