![]() ![]() ![]() ![]() | Table Of Contents | Index |
One of the most unusual things about MarxMenu is its variables. MarxMenu handles variables differently than any other programming language. For the experienced programmer, this may require some adjustment since it's like getting used to driving a Cadillac after driving a VW Beetle.
All variables in MarxMenu are like an empty box that can contain anything. A variable can be a number, boolean, string, file, array, etc. The type of variable is controlled internally and the user need not declare variable types.
Variables are created with the VAR command:
Var X Y ZIf the word VAR is on a line by itself, the following lines, up to a blank line, are considered variable names.
Var MyAge YourAge HisAge HerAgeVariables are initialized to null values; 0 for Numbers, False for Booleans, and '' for strings. Initial values can be set when the variable is created.
Var X = 6 MyName = 'Marc' Programmer = TrueVariables can change variable types. If you write a number to a string variable, the variable changes to a number.
X = '234' X = Value(X)This is valid in MarxMenu. X now is a number and contains the value 234.
When choosing variable names, it is good programming practice to choose long meaningful names. This allows yourself and others to be able to read menus and follow the logic more easily.
![]() ![]() ![]() ![]() | Table Of Contents | Index |
|