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

uses
  Crt, StringUtils, SySutils, Joystick;

var
  eff_loop_var : byte;
  eff_cnt : byte;
  eff_string : string;
// Effectus example:
// Using custom/local FUNCtion

function SumFunc(nn1 : word; nn2 : word) : word;
var
  res : word;  // res_byte_array
begin
  res := nn1+nn2;
  result := res;
end;
procedure MAINProc;
var
  n1 : word;  // n1_byte_array
  n2 : word;  // n2_byte_array
  n3 : word;  // n3_byte_array
begin
  Write(Chr(125));
  eff_string := '';
  Write('Effectus example:');  // Print 1
  Writeln;
  eff_string := '';
  Write('Using local functions(FUNC)');  // Print 1
  Writeln;
  Writeln('');
  n1 := 30;
  n2 := 120;
  eff_string := '';
  Write('Custom function Sum');  // Print 1
  Writeln;
  Writeln('');
  eff_string := '';
  Write('n1=30,n2=120,with sum of n3=');  // Print 1

  n3 := SUMFunc(N1,N2);
  eff_string := '';
  Write(n3);  // Print 2
  Writeln;
  n1 := 255;
  n3 := SUMFunc(N1,255);
  eff_string := '';
  Write('n1=255 with 255 added is ');  // Print 1

  eff_string := '';
  Write(n3);  // Print 2
  Writeln;
  Writeln('');
  eff_string := '';
  Write('Press trigger');  // Print 1
  Writeln;
 WHILE STRIG[0]=1 do begin
  end;
  eff_string := '';
  Write('Trigger pressed');  // Print 1
  Writeln;
  eff_string := '';
  Write('Program finished!');  // Print 1
  Writeln;
  repeat
 UNTIL STRIG[0]=0;
  eff_string := '';
  Write('Trigger pressed');  // Print 1
  Writeln;
  eff_string := '';
  Write('Program finished!');  // Print 1
  Writeln;
end;

begin
  MAINProc;
end.
