plusBASIC Quick Reference - fvdhoef/aquarius-plus GitHub Wiki

Quick Reference Guide

Literals

  • Numeric literals evaluate to floating point or integer numbers.
    • {+|-}{digit...|{digit}{.}{digit...}}{E{+|-}digit...} - A floating point decimal number.
    • {+|-}{digit...} - An integer decimal number.
    • $hexdigit... - An integer hexadecimal number.
    • 'character' - An integer number equal to the ASCII code of character.
  • String literals evaluate to a string of ASCII characters.
    • "{character...}" - A string containing the specified characters.
    • $"{hexdigit...}" - A string containing the characters specified by each two-digit hexadecimal number.
    • \"{{\}character}..." - A string containing C style escape codes.

Variables

  • Numeric variables contain an floating point or integer numbers.
    • alpha{alphanum|~...} - Numeric variable.
    • alpha{alphanum|~...}((index{,index...}) - Numeric array element.
  • String variables contain a string of ASCII characters.
    • alpha{alphanum|~...}$ - String variable.
    • alpha{alphanum|~...}$((index{,index...}) - String array element.
  • String slices represent a substring of a string variable.
    • var$[pos] - Character pos of string variable var$.
    • var$[start TO end] - Characters start through end of string variable var$.
    • array$(...)[pos] - Character pos of string array element array$(...).
    • array$(...)[start TO end] - Characters start through end of string array element array$(...).

Operators

  • Arithmetic operations evaluate performed using floating point math.
    • - expression - Negate expression
    • expression + expression - Add second expression to first expression.
    • expression - expression - Subtract second expression from first expression.
    • expression * expression - Multiply first expression by second expression.
    • expression / expression - Divide first expression by second expression.
    • expression ^ expression - Raise first expression to power second expression.
    • expression MOD expression - Calculate the remainder of the first expression divided by the second expression.
  • Relational operations return -1 if true, 0 if false.
    • expression > expression - True if first expression is greater than second expression.
    • expression = expression - True if first expression is equal second expression.
    • expression < expression - True if first expression is less than second expression.
    • expression >= expression - True if first expression is greater than or equal to second expression.
    • expression <= expression - True if first expression is less than or equal to second expression.
  • Logical operators perform the corresponding boolean operation on the bits of the each integer expression.
    • NOT integer - Sets resulting bit to 1 if the operand bit is 0.
    • integer AND integer - Sets resulting bit to 1 if both operand bits are 1.
    • integer OR integer - Sets the resulting bit to 1 if either operand bit is 1.
    • integer XOR integer - Sets resulting bit to 1 if one operand bits is 1, and the other is 0.
  • String operators create new temporary string.
    • string + string - Concatenates second string to the end of first string.
    • string %% (expression{,...}) - Perform string substitution.

Special Characters

  • _label - Line label. Valid at the beginining of a line, or as the operand of a GOTO or GOSUB.
  • 'comment - Shortcut for REM. Valid at the beginning of a line, or after a statement terminating colon.

Statements and Functions