Syntax fundamentals

<< Click to Display Table of Contents >>

Syntax fundamentals

Comments

Text that is preceded by the keyword Rem or an apostrophe (') will be seen as a comment and not executed. You can use comments to annotate your scripts.

' This is a comment

rem This too

REM This too

Rem This too

As you can see, the Rem statement is not case-sensitive. This is the same with all keywords in SoftMaker Basic.

Comments can also be placed at the end of a line:

MsgBox Msg ' Display message

The text after the apostrophe is a comment.

Multiple statements in a line

You can place several statements on the same line, separating them by colons:

X.AddPoint(25,100) :  Y.AddPoint(0,75)

... is identical to ...

X.AddPoint(25,100)

Y.AddPoint(0,75)

Statements spanning several lines

You can make a statement span several lines by ending each line except the last with a space and an underscore (_).

Print _

"Hello!"

... is identical to ...

Print "Hello!"

Numbers

You can write numbers in three different ways: decimal, octal and hexadecimal:

Decimal numbers: Most of the examples in this manual employ decimal numbers (base 10).

Octal numbers: If you would like to use octal numbers (base 8), place &O in front of the number – for example &O37.

Hexadecimal numbers: For hexadecimal numbers (base 16), use the prefix &H – for example &H1F.

Names

Variables, constants, subroutines and functions are addressed by their names. The following naming conventions apply:

Only the letters A-Z and a-z, underscores (_) and the digits 0-9 are allowed.

Names are not case-sensitive.

The first letter of a name must always be a letter.

The length may not exceed 40 characters.

Keywords of SoftMaker Basic may not be used.