About Variables

Prev Next Home Home Table Of Contents Index

ABOUT VARIABLES

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 Z

If 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
   HerAge

Variables 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 = True

Variables 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.

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home