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.
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.
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.
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
The following is a summary of the features of LB that should not require any changes to code being ported to ViviFire.
|Arithmetic operators||+, -, *, /, Mod, ^|
|Comparison operators||<, <=, =, <>, >, >=|
|Do...Loop statement||Multi-line form only|
|Function statement||RB's privacy semantics aside|
|If...Then...Else statement||Multi-line form only|
|Logical operators||And, Or, Xor; except when the precedence level matters. Each has a different precedence level in ViviFire.|
|Sub statement||RB's privacy semantics aside|
The following table summarizes the situations where LB and ViviFire share keywords but they are used for different purposes.
Liberty BASIC and Run BASIC are trademarks of Shoptalk Systems.