// Effectus auto-generated Mad Pascal source code listing
program recsPrg;

uses
  Crt, StringUtils, SySutils, CIO;

var
  strBuffer : string;
var
  eff_loop_var : byte;
  eff_cnt : byte;
  eff_string : string;
// Effectus example:
// Record ARRAY demonstration
type
  rec = record  // rec_byte_array
  NUM1 : byte;  // NUM1_byte_array
  NUM2 : word;  // NUM2_byte_array
  NUM3 : word;
  end;  // type
var
  DATA : array[0..15] of byte;  // DATA_byte_array
  ENTRY : ^rec;  // ENTRY_byte_array
  KEY : byte;  // KEY_byte_array

procedure MAINProc;
begin
  Write(Chr(125));
  eff_string := '';
  Write('Effectus example:');  // Print 1
  Writeln;
  eff_string := '';
  Write('Record ARRAY demonstration');  // Print 1
  Writeln;
  Writeln('');
  ENTRY := pointer(word(@DATA));
  Inc(ENTRY, 0);
// ENTRY=DATA+(0*5)
  ENTRY^.NUM1 := 10;
  ENTRY^.NUM2 := 1000;
  ENTRY^.NUM3 := 10000;
  ENTRY := pointer(word(@DATA));
  Inc(ENTRY, (1*5));
  ENTRY^.NUM1 := 20;
  ENTRY^.NUM2 := 2000;
  ENTRY^.NUM3 := 20000;
  ENTRY := pointer(word(@DATA));
  Inc(ENTRY, (2*5));
  ENTRY^.NUM1 := 30;
  ENTRY^.NUM2 := 3000;
  ENTRY^.NUM3 := 30000;
  eff_string := '';
  Write('Some data retrieved from the records');  // Print 1
  Writeln;
  Writeln('');
  ENTRY := pointer(word(@DATA));
  Inc(ENTRY, 0);
  eff_string := '';
  Write('entry.num1=');  // Print 1

  eff_string := '';
  Write(ENTRY.NUM1);  // Print 2
  Writeln;
  ENTRY := pointer(word(@DATA));
  Inc(ENTRY, 5);
  eff_string := '';
  Write('entry.num2=');  // Print 1

  eff_string := '';
  Write(ENTRY.NUM2);  // Print 2
  Writeln;
  ENTRY := pointer(word(@DATA));
  Inc(ENTRY, 10);
  eff_string := '';
  Write('entry.num3=');  // Print 1

  eff_string := '';
  Write(ENTRY.NUM3);  // Print 2
  Writeln;
  Write('', eol, '---------------------');
  KEY := Get(7);
  ReadKey;
end;

begin
  MAINProc;
end.
