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
mpl [2016/07/11 16:36] – [Mystic Programming Language] gryphonmpl [2016/07/13 21:27] (current) 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 24: Line 23:
 ==== Comments ==== ==== Comments ====
  
-All text after a two slashes (⁄⁄) is considered a comment.  It will be ignored until the next line of code.  For example: +All text after a two slashes (⁄⁄) is considered a comment.  It will be ignored until the next line of code.  For example: 
   WriteLn ('Hello There' ⁄⁄ This is a comment and will be ignored.   WriteLn ('Hello There' ⁄⁄ This is a comment and will be ignored.
      
Line 53: Line 53:
  
   Const   Const
-  UserDeleted = $04;  // established bit for userdeleted from records.pas +    UserDeleted = $00000004;  // Deleted bit from records.pas 
-                      // note: this value has changed check records.pas!+  
   Begin   Begin
-    GetThisUser+    GetThisUser;
      
     If UserFlags AND UserDeleted <> 0 Then     If UserFlags AND UserDeleted <> 0 Then
-      WriteLn('User is deleted'); +      WriteLn('User is deleted');       
-    End;+  End;
    
 ==== Defining Variables ==== ==== Defining Variables ====
 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 87:
   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 98:
 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 320:
  
 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.1468272977.txt.gz · Last modified: 2016/07/11 16:36 by gryphon

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki