Skip to end of metadata
Go to start of metadata

Variables are typeless. They can contain strings, integers, or floating point numbers (which are stored up to a precision of 13 places).

Variables are treated in a context-sensitive fashion. In other words, if a mathematical operation is attempted on a variable that contains the string 123 , it is converted to an integer, and then the mathematical operation applied. If the string is a word, it is treated as 0 for the purposes of the mathematical operation.

The period (.) can be used as a concatenation operator. For example, in the following programs segment:

A = 5;

B = "6";

C = "2.1";

D = "Hello";

E = A + B;

F = B + C;

G = D + A;

H = D . B . A;

E contains the value 11, and F contains the value 8.1. G contains the value 5.

The "." operator in H appends the value of D to B to A. For example, H="to"."gether" or Together".

"Hello" was treated as 0 (zero) in the mathematical operation. H, however, contains the sting "Hello65".

  • No labels