home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d512 / m2pascal.lha / M2Pascal / test.p < prev   
Text File  |  1991-07-20  |  964b  |  53 lines

  1. program test ( input, output );
  2. {  This is a simple m2 source program designed to test m2pascal.
  3.  }
  4.  
  5. const
  6.         C1    =    10;
  7.  
  8.  
  9. type
  10.         ConnectPtr  =  ^ConnectType;    
  11.     ConnectType =  record
  12.             node    : integer;
  13.             next    : ConnectPtr;        
  14.     end;
  15.  
  16.     ArrayType = array [ 1.. C1 ] of  boolean;
  17.  
  18. var  
  19.         v1int           : integer;
  20.         v2card          : integer;
  21.         v3real          : real;
  22.  
  23. function proc1() : integer;
  24. begin
  25.     if C1 = 10 then begin
  26.         proc1 :=  C1;
  27.     end
  28.     else begin
  29.         proc1 :=  0;
  30.     end;
  31. end;
  32.  
  33. begin {  main  }
  34.    v1int   :=   1;
  35.    v2card  :=   2;
  36.    v3real  :=   3.0;
  37.  
  38.            {  Test while loop  }
  39.    while ( v1int < 2 ) do begin
  40.          v1int  :=  v1int  - 1;
  41.    end;
  42.  
  43.  
  44.           {  Test repeat loop  }
  45.    repeat
  46.        v1int := 1;
  47.    until ( v1int < 2 ) ;
  48.  
  49.    writeln (' Simple test program written in Module-2 to '); 
  50.    writeln (' demonstrate m2pascal (type more test.mod to see) '); writeln;
  51. end.
  52.  
  53.