Variable and Constant
| HOME |
A variable in Noobeed can have a length of up to 1000 characters, and it must fulfill the following conditions.
To view existing variables, use command "list var", or "flist var". To clear existing variables, use command "clear" followed by variables name delimited by space, or use command "clear all" to clear all existing variables.
To view the content of a variable, use command "print" followed by the variable name, or just type the name of the variable and press enter key.
There are 3 types of constants in Noobeed, namely numerical constant, string constant and matrix constant.
A numerical constant consists of numbers and must not have a space, blank, in it. It is always interpreted as a type of double precision. Other types of numerical constants, such as integer, float, short, etc., must declare by using a global function, for example int(12), float(50). See example below.
A string constant is any legal character surrounded by two double quotation signs. One at the beginning and the other at the end. Legal characters are listed in statement and syntax section.
A matrix constant is created by putting numbers inside a pair of brackets. Each number is a value of an element in a matrix. Numbers are separated by one or more spaces, and a semi-colon ";" sign is used to separate rows in a matrix. Expressions inside the bracket are possible, however, each element now must be separated by a comma ",". To get more understanding, please see examples. Sub-matrices can also be put together to build a larger matrix, see the last two examples below.
Please consider the following examples.