Syntax Diagrams

Sisukord
Register 🔎︎

# How to Read Syntax Diagrams and Statements

LibreOffice Basic statements use syntax diagrams and textual conventions that follow these typographical rules:

- LibreOffice Basic keywords or functions use proper casing: Call, DimArray, InputBox, Property.

- Lowercase characters indicate information to supply: end, expression, start, variable.

The syntax of a LibreOffice Basic one line statement is illustrated herewith:

## Diagram example

- Basic statement diagrams start and end with double vertical bars,

- Loops indicate a possible repetition, an optional separator may be present,

- Rectangles denote subsequent diagram fragments,

- Diagram fragments extremities exhibit single vertical bars.

A set of LibreOffice Basic statements - with optional labels - is using a colon : sign to separate them, it can be terminated with an optional comment. REM or an apostrophe sign introduce a comment.

## Textual example

- [opt1|opt2|opt3] Items inside brackets are optional, alternatives are indicated with a vertical bar,

- case[[sep]…] An ellipsis indicates a possible repetition, an optional separator may be specified,

- {choice1|choice2} Items inside curly braces are compulsory, alternatives are indicated with a vertical bar.

[ [label:] statement [: …] ] [{REM|'} text]

A set of LibreOffice Basic statements - with optional labels - is using a colon : sign to separate them, it can be terminated with an optional comment. REM or an apostrophe sign introduce a comment.

### Näide:

           Sub Main
               GoTo there ' skip first statement
               here: Print 1, : there: Print 2 REM explanatory text here
           End Sub

Sarnased teemad

GoTo lause

Print# Statement

Rem Statement

Sub Statement