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
Last revisionBoth sides next revision
mpl [2016/07/11 16:51] gryphonmpl [2016/07/13 21:23] g00r00
Line 64: 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 86: 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 96: 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 ====
mpl.txt · Last modified: 2016/07/13 21:27 by g00r00

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki