Enhavo

# How to Read Syntax Diagrams and Statements

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

- LibreOffice Basic keywords or functions use camel 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 mandatory, 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.

### Example:

           Sub Main
               GoTo there ' skip first statement and display '2'
               here: Print 1, : there: Print 2 REM multi-statement line
           End Sub

Rilataj temoj

GoTo Statement

Print# Statement

Rem Statement

Sub Statement