User guide
eWON 500-2001-4001-4002 User Guide - Programming the eWON
eWON 500®2001®4001®4002® Version 4_3_0 - User Guide - 10/5/05 - ©ACT'L sa - Page 128
9.1.10 Type of Variables
9.1.10.1 Integer variable
Syntax
a%
a is a letter from "a" to "z". The name of the variable is followed by the "%" letter to indicate that it is an integer variable.
An integer variable can contain a number of type integer.
9.1.10.2 Real variable
Syntax
abcdef
abcdef is the name of the variable that can contain up to 200 characters. Variable names are case insensitive:
AbCdEf and ABCDEF represent the same variable.
The variable name can only contain the letters "a" to "z"; all other characters are not allowed. The variable name can contain alphabetical
characters, numbers and "_" underscore, but name must begin with an alphabetical character. Others characters are not allowed. Examples:
MyVar = 12.3 (valid)
My Var = 12.3 (invalid)
My_Var = 12.3 (valid)
Var1 = 12.3 (valid)
1Var = 12.3 (invalid)
A real variable can contain a real number.
9.1.10.3 Alphanumeric string
Syntax
a$
a is a letter from "a" to "z". The name of the variable is followed by the "$" letter to indicate that it is a string.
A string can contain any number of characters. Its size is modified each time the content of the variable is modified.
It is possible to address parts of a string with the TO keyword:
9.1.10.4 Characters arrays
The number of dimensions is only limited by the memory size of the BASIC.
When the DIM command is called, the array is created and replaces any other DIM or VAR existing with the same name.
To erase an array you can either use the CLEAR command that erases all variables, or change the dimension of the array to 1 element with
another call to DIM if you don’t want to clear everything but need to release memory.
An array of which name is a$(E1,E2,E3) and an alphanumeric variable of which name is a$ can exist simultaneously.
A characters array contains E1*E2*E3 *... characters.
Syntax [Command]
DIM a$(E1 [, E2 [, E3 [,....]]])
a$ is the name of the variable array created, its name only contains one active character of "a" until "z".
E1 is the number of characters for the first dimension. E2, E3, E4 are optional and are present if the array must have 2, 3, 4,...dimensions.
Examples:
A$(4 TO 10) returns a string with chars 4 to 10
A$(4 TO) returns a string with character 4 to end of string
A$(4 TO LEN(A$)) same result
DIM A$(10,20)
DIM Z(6)
A$(4, 3 TO 3) same kind of access with arrays