Liberty BASIC Family Compared to ViviFire

The syntax of Liberty BASIC and Run BASIC had an effect on ViviFire, but it is not the same language. This article gives a summary of the elements that are different.

Names

ViviFire lets you use Unicode in names of elements, for example, variables and functions. You can use many scripts, for example, Latin with diacritics, Greek, Cyrillic, Arabic, Chinese, and more.

All keywords and almost all names ignore letter case. Only units of measure must keep the same letter case. If a person writes a library with a different style, frequently you can ignore it and use your style. See Declared Element Names for more information.

Scoping

Scope in LB and RB is not as easy compared to ViviFire. In ViviFire, a named element declared in an outer code block has visibility in it. Thus in ViviFire, GLOBAL is not necessary, because elements declaredd at the top level are automatically global.

As with RB, block constructs (for example, loops) make a new local scope. Thus variables declared in these blocks do not had visibility in outer blocks.

Although RB and ViviFire let you make objects, ViviFire gives you much more functionality. While RB uses function procedures to identify an object's methods, ViviFire has the keyword Method. In ViviFire, Subs and Functions are always private to the object in which they are declared.

Labels

ViviFire does not have branch labels. Although ViviFire has elements that can make you think they are labels, they are not labels. Thus all control flow must be structured. These include:

  1. procedures:
  2. Structured loops:
  3. Conditional statements:

ViviFire does not have GOSUB, but does have something almost the same as GOTO. The statement GoTo Case is permitted in Select…Case.

Also, ViviFire does not have ON ERROR GOTO. The alternative that ViviFire uses is structured exceptions, which use Try…Catch…Finally.

Comparison of features

Equivalent features

Some features of LB and ViviFire are almost the same.

Feature Information
Arithmetic operators +, -, *, /, Mod, ^
Comparison operators <, <=, =, <>, >, >=
Do…Loop Block construct only
Exit
Function RB semantics ignored
If…Else Block construct only
Logical operators And, Or, Xor; precedence ignored
ReDim
Sub RB semantics ignored

Incompatibilities

The table that follows gives the times where LB/RB and ViviFire use the same keywords for different functions.

Feature Information
GoTo
  • In LB, it is used to unconditionally move to a label.
  • In ViviFire, it is used only in the statement GoTo Case which is available only in Select…Case.
Rem
  • In LB, it is short for “remark” and marks the start of a remark that extends to the end of the line.
  • In ViviFire, it is short for “remainder” and is an operator related to Mod.
Return
  • In LB, it is the end of a block of code run with GOSUB.
  • In ViviFire, it uses a smaller number of statements to set the return value of a function or method then do Exit, or is an alternative to Exit Sub.