User Tools

Site Tools


mpl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
mpl [2016/07/11 16:36] – [Mystic Programming Language] gryphonmpl [2016/07/13 21:23] g00r00
Line 1: Line 1:
 ====== Mystic Programming Language ====== ====== Mystic Programming Language ======
-====== General Functions and Procedures ===== 
  
 ===== General Notes About Using The MPL ===== ===== General Notes About Using The MPL =====
Line 65: Line 64:
 All variables are global to all of the program, including procedures.  The syntax for declaring a variable follows: All variables are global to all of the program, including procedures.  The syntax for declaring a variable follows:
  
-  Var <VarName> : <VarType>+  Var <Variable Name> : <Variable Type>
      
   Examples:   Examples:
      
-  var dummy byte +  Var Dummy Byte; 
-  var str   : string+  Var Str   : String;
      
-  var +  Var 
-    dummy : byte+    Dummy1
-    str   string+    Dummy2  Byte;
      
 The following variable types are supported: The following variable types are supported:
Line 87: Line 86:
   Word            Numerical      0..65535   Word            Numerical      0..65535
   LongInt         Numerical      -2147483648..214748364   LongInt         Numerical      -2147483648..214748364
 +  Cardinal        Numerical      0..4294967295
   Real            Numerical      9.99   Real            Numerical      9.99
  
-All variables except ARRAYs can be initialized when when defined.+All variables except ARRAYs can be initialized when when defined:
  
   Var TotalBases : LongInt = GetMBaseTotal(False)   Var TotalBases : LongInt = GetMBaseTotal(False)
Line 97: Line 97:
 ARRAY multi-dimensional variables are supported.  The syntax for declaring an array variable is: ARRAY multi-dimensional variables are supported.  The syntax for declaring an array variable is:
  
-  Var <VarName> ARRAY[<Low>..<High>] of <VarType> +  Var <VarName> : ARRAY[<Low>..<High>] of <VarType> 
-  Var <VarName> ARRAY[<L>..<H>, <L>..<H>] of <VarType> +  Var <VarName> : ARRAY[<L>..<H>, <L>..<H>] of <VarType> 
-  Var <VarName> ARRAY[<L>..<H>, <L>..<H>, <L>..<H>] of <VarType>+  Var <VarName> : ARRAY[<L>..<H>, <L>..<H>, <L>..<H>] of <VarType>
  
 Examples: Examples:
  
-  Var Dummy : Array[1..10] of Byte +  Var Dummy : Array[1..10] of Byte; 
-  Var Str   : Array[5..10] of String +  Var Str   : Array[5..10] of String; 
-  Var Int   : Array[1..10,1..10,1..10] of Integer+  Var Int   : Array[1..10, 1..10, 1..10] of Integer;
  
-HEXIDECIMAL values are supported.  They can be used in numeric variable assignment numerical evaluation, and in numeric constant variables.  A hex value must begin with a $ character+HEXIDECIMAL values are supported.  They can be used in numeric variable assignment numerical evaluation, and in numeric constant variables.  A hex value must begin with a $ character:
-Some examples:+
  
   Const   Const
     MyHexValue = $1F;     MyHexValue = $1F;
      
-    Value := $10;+  Value := $10;
      
-  If Value = $10 Then WriteLn('Value is 16 <in decimal>');+  If Value = $10 Then 
 +    WriteLn('Value is 16 <in decimal>');
  
 ==== Record Structures ==== ==== Record Structures ====
Line 319: Line 319:
  
 At the moment, constant variables cannot be used in certain places within the MPE engine.  If you are assigning a value to a variable, constant values will not be recognized. At the moment, constant variables cannot be used in certain places within the MPE engine.  If you are assigning a value to a variable, constant values will not be recognized.
-===== 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('The absolute value of '+Int2str(Int) +' is '+Abs(Int)+'.') 
-==== Function ALLOWARROW (Boolean) ==== 
- 
-Used to turn on arrow key processing in the READKEY function.  It is also used outside of MPL so use with caution. 
- 
-Example: 
- 
-  AllowArrow := True 
-  ReadKey 
  
mpl.txt · Last modified: 2016/07/13 21:27 by g00r00

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki