Liberty BASIC Family Compared to ViviFire

The syntax of ViviFire was inspired by Liberty BASIC and Run BASIC, but it is not the same language. The following document will summarize the major differences.

Names

ViviFire offers much greater freedom in naming entities such as variables and functions. ViviFire has deep support for Unicode and allows names in numerous scripts, including Latin with diacritics, Greek, Cyrillic, Arabic, Chinese, and more.

All names in ViviFire are case-insensitive, not just keywords. This was chosen to make it easier to share and reuse code. If somebody writes a library that uses a capitalization scheme you don't like, just type the names the way you prefer!

For more details, see Declared Element Names.

Scoping

Both LB and RB have rather complicated scoping rules compared to ViviFire. In ViviFire, any named entity defined outside of a construction is visible within it. That means that ViviFire has no need for a GLOBAL keyword, because anything defined at the outermost level is automatically global.

Like RB, block constructions (such as loops) create a new scoping level. This means that variables defined within these blocks are not visible outside them.

Also like RB, ViviFire allows for user-defined objects, but with much more functionality. Whereas RB reuses functions to define an object's methods, ViviFire has a Method keyword specifically for this purpose. Subs and Functions in ViviFire are always private to the object in which they are defined.

Labels

ViviFire has no support for branch labels. Although ViviFire permits the use of what look like labels in certain statements, be assured they are not labels. This means that all branching in ViviFire must be done in a structured way. These ways include procedures (Sub, Function, Method), structured loops (Do...Loop, While, For...To, For Each...In) and Exit, If...Then...Else, and Select...Case.

ViviFire lacks GOSUB, but retains a form of GOTO. The GoTo Case statement is permitted within a Select...Case block.

Also, ViviFire lacks ON ERROR GOTO. Instead, it uses structured exception handling, using Try...Catch...Finally blocks.

Comparison of features

Feature equivalence

The following is a summary of the features of LB that should not require any changes to code being ported to ViviFire.

FeatureNotes
Arithmetic operators+, -, *, /, Mod, ^
Comparison operators<, <=, =, <>, >, >=
Do...Loop statementMulti-line form only
Exit statement
Function statementRB's privacy semantics aside
If...Then...Else statementMulti-line form only
Logical operatorsAnd, Or, Xor; except when the precedence level matters. Each has a different precedence level in ViviFire.
ReDim statement
Sub statementRB's privacy semantics aside

Incompatibilities

The following table summarizes the situations where LB and ViviFire share keywords but they are used for different purposes.

FeatureNotes
GoTo
  • In LB, it is used to unconditionally branch to a label.
  • In ViviFire, it is used only in the GoTo Case statement which is available only inside a Select...Case block.
Rem
  • In LB, it is short for "remark" and marks the beginning 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 used to mark the end of a GOSUB routine.
  • In ViviFire, it is a shorthand way to set the return value of a Function or Method and Exit, or is just another way to do Exit Sub.

Liberty BASIC and Run BASIC are trademarks of Shoptalk Systems.