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

uses
  Crt, StringUtils, SySutils, CIO;

var
  strBuffer : string;
var
  eff_loop_var : byte;
  eff_cnt : byte;
  eff_string : string;
// Effectus example:
// Number to string conversion using
// StrB, StrI and StrC procedures
// 
// String to number conversion by using
// ValB, ValI and ValC functions
var
  key : byte;  // key_byte_array
  num1 : byte;  // num1_byte_array
  num2 : integer;  // num2_byte_array
  num3 : word;  // num3_byte_array
  strnum1 : array[0..6] of byte;  // strnum1_byte_array
  strnum2 : array[0..6] of byte;  // strnum2_byte_array
  strnum3 : array[0..6] of byte;  // strnum3_byte_array

procedure MAINProc;
begin
  Write(Chr(125));
  eff_string := '';
  Write('Effectus example:');  // Print 1
  Writeln;
  Writeln('');
  eff_string := '';
  Write('Number to string conversion using');  // Print 1
  Writeln;
  eff_string := '';
  Write('StrB,StrI and StrC procedures');  // Print 1
  Writeln;
  Writeln('');
  eff_string := '65000';
  for eff_loop_var := 0 to 6 do    strnum1[eff_loop_var] := 32;
  for eff_loop_var := 0 to 4 do strnum1[eff_loop_var] := Ord(eff_string[eff_loop_var + 1]);
  eff_string := '3200';
  for eff_loop_var := 0 to 6 do    strnum2[eff_loop_var] := 32;
  for eff_loop_var := 0 to 3 do strnum2[eff_loop_var] := Ord(eff_string[eff_loop_var + 1]);
  eff_string := '210';
  for eff_loop_var := 0 to 6 do    strnum3[eff_loop_var] := 32;
  for eff_loop_var := 0 to 2 do strnum3[eff_loop_var] := Ord(eff_string[eff_loop_var + 1]);
  eff_string := '';
  Write('strnum1=');  // Print 1

  eff_string := '';
  for eff_loop_var in strnum1 do StrAdd(eff_string, chr(eff_loop_var));
  Write(Trim(eff_string));
  Writeln;
  eff_string := '';
  Write('strnum2=');  // Print 1

  eff_string := '';
  for eff_loop_var in strnum2 do StrAdd(eff_string, chr(eff_loop_var));
  Write(Trim(eff_string));
  Writeln;
  eff_string := '';
  Write('strnum3=');  // Print 1

  eff_string := '';
  for eff_loop_var in strnum3 do StrAdd(eff_string, chr(eff_loop_var));
  Write(Trim(eff_string));
  Writeln;
  num3 := 35000;
  eff_string := IntToStr(num3);
  for eff_loop_var := 0 to 6 do    strnum1[eff_loop_var] := 32;
  for eff_loop_var := 0 to Length(eff_string) - 1 do strnum1[eff_loop_var] := Ord(eff_string[eff_loop_var + 1]);
  num2 := 3100;
  eff_string := IntToStr(num2);
  for eff_loop_var := 0 to 6 do    strnum2[eff_loop_var] := 32;
  for eff_loop_var := 0 to Length(eff_string) - 1 do strnum2[eff_loop_var] := Ord(eff_string[eff_loop_var + 1]);
  num1 := 230;
  eff_string := IntToStr(num1);
  for eff_loop_var := 0 to 6 do    strnum3[eff_loop_var] := 32;
  for eff_loop_var := 0 to Length(eff_string) - 1 do strnum3[eff_loop_var] := Ord(eff_string[eff_loop_var + 1]);
  eff_string := '';
  Write('strnum1=');  // Print 1

  eff_string := '';
  for eff_loop_var in strnum1 do StrAdd(eff_string, chr(eff_loop_var));
  Write(Trim(eff_string));
  Writeln;
  eff_string := '';
  Write('strnum2=');  // Print 1

  eff_string := '';
  for eff_loop_var in strnum2 do StrAdd(eff_string, chr(eff_loop_var));
  Write(Trim(eff_string));
  Writeln;
  eff_string := '';
  Write('strnum3=');  // Print 1

  eff_string := '';
  for eff_loop_var in strnum3 do StrAdd(eff_string, chr(eff_loop_var));
  Write(Trim(eff_string));
  Writeln;
  Writeln('');
  eff_string := '';
  Write('String to number conversion by using');  // Print 1
  Writeln;
  eff_string := '';
  Write('ValB,ValI and ValC');  // Print 1
  Writeln;
  Writeln('');
  eff_string := '     ';
  for eff_loop_var := 0 to SizeOf(strnum3) - 1 do begin
    eff_string[eff_loop_var + 1] := chr(strnum3[eff_loop_var]);
  end;
  num1 := StrToInt(eff_string);
  eff_string := '';
  Write('num1=');  // Print 1

  eff_string := '';
  Write(num1);  // Print 2
  Writeln;
  num2 := StrToInt('1500');
  eff_string := '';
  Write('num2=');  // Print 1

  eff_string := '';
  Write(num2);  // Print 2
  Writeln;
  num3 := StrToInt('44611');
  eff_string := '';
  Write('num3=');  // Print 1

  eff_string := '';
  Write(num3);  // Print 2
  Writeln;
  key := Get(7);
  ReadKey;
end;

begin
  MAINProc;
end.
