mpl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
mpl [2016/07/11 16:28] – [CASE Statements] gryphon | mpl [2016/07/11 16:43] – [Mystic Programming Language] gryphon | ||
---|---|---|---|
Line 288: | Line 288: | ||
==== FUNCTIONS ==== | ==== FUNCTIONS ==== | ||
+ | The syntax for defining a function is as follows: | ||
+ | |||
+ | Function < | ||
+ | |||
+ | IE: | ||
+ | |||
+ | Function AddTen (Num Byte) : Byte | ||
+ | Begin | ||
+ | AddTen := Num + 10 | ||
+ | End | ||
+ | ==== CONST VARIABLES ==== | ||
+ | The syntax for a constant variable is as follows: | ||
+ | |||
+ | String constants: | ||
+ | |||
+ | Const | ||
+ | SomeStr = 'Hello World!' | ||
+ | |||
+ | Numerical constants: | ||
+ | |||
+ | Const | ||
+ | SomeNum = 69 | ||
+ | |||
+ | Constant variables, like regular variables, can be separated with a comma: | ||
+ | |||
+ | Const | ||
+ | SomeNum = 69, | ||
+ | SomeStr = 'Hello World!' | ||
+ | |||
+ | At the moment, constant variables cannot be used in certain places within the MPE engine. | ||
+ | ====== General Functions and Procedures ====== | ||
+ | ==== Function ABS (Num: LongInt) : LongInt ==== | ||
+ | |||
+ | This function takes a signed integer and returns the absolute value. | ||
+ | Example: | ||
+ | |||
+ | Var Int : LongInt = -1234 | ||
+ | | ||
+ | WriteLn(' | ||
+ | ==== Function ALLOWARROW (Boolean) ==== | ||
+ | |||
+ | Used to turn on arrow key processing in the READKEY function. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | AllowArrow := True | ||
+ | ReadKey | ||
+ |
mpl.txt · Last modified: 2016/07/13 21:27 by g00r00