Skip to content
Peter Verhas edited this page Dec 17, 2019 · 7 revisions

The BASIC language interpreted by ScriptBasic for Java

The language implemented byScriptBasic for Java is a simple BASIC language. There are only a very few commands implemented to keep the language simple, easy to learn. Each command starts on a new line, and after version 2.0.1 you can also use the : character to put multiple commands on a single line.

The following commands are implemented:

The operators implemented in the language are

  • -, + and not unary operators.

  • . (dot) to access Java object fields (1)

  • ^ power operator (2)

  • * multiply (3)

  • / division (floating point) (3)

  • % modulo calculation (3)

  • div integer divide (3)

  • + binary add operator, works on integer values, float values and concatenates strings (4)

  • - binary minus (4)

  • = equality, < 'less than', > 'greater than', >= 'greater or equal', <= 'less or equal', <>'not equal' operators that compares values (5)

  • and logical (short circuit) and operator (6)

  • or logical (short circuit) or operator (6)

The operators have the usual precedences, as listed at the end of the lines above. You can use ( and ) parentheses to change the order of the evaluation of the operations. You can also use the parenthesis to call declared Java methods and to call BASIC defined subroutines.

Arrays can be accessed using the [ and ] brackets. Multidimensional array indices are separated by , comma. There is no array of arrays.

File handling is available via an extension class. This extension class is not loaded by default. The embedding application should register this extension class. The command-line version does register this class.

Clone this wiki locally