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

uses
  Crt, StringUtils, SySutils, CIO;

var
  strBuffer : string;
var
  eff_loop_var : byte;
  eff_cnt : byte;
  eff_string : string;
// Effectus example:
// Device I/O demo using InputSD and
// InputMD procedures to read text file
// 
// Sample file on H1: device: TEST.TXT
var
  key : byte;  // key_byte_array
  str_buffer1 : array[0..254] of byte;  // str_buffer1_byte_array

procedure MAINProc;
begin
  Write(Chr(125));
  eff_string := '';
  Write('Device I/O demo');  // Print 1
  Writeln;
  eff_string := '';
  Write('using InputSD and InputMD procedures');  // Print 1
  Writeln;
  eff_string := '';
  Write('to read text file');  // Print 1
  Writeln;
  Writeln('');
  eff_string := '';
  Write('Sample file: TEST.TXT');  // Print 1
  Writeln;
  Cls(1);
  Opn(1, 4, 0, 'H1:TEST.TXT');
  Write('', eol, 'InputSD example:', eol, '');
  BGet(1,  str_buffer1, SizeOf( str_buffer1));
  eff_string := '';
  for eff_loop_var in str_buffer1 do StrAdd(eff_string, chr(eff_loop_var));
  Write(Trim(eff_string));
  Writeln;
  Cls(1);
  Opn(1, 4, 0, 'H1:TEST.TXT');
  Write('', eol, 'InputMD example:', eol, '');
  BGet(1,  str_buffer1,  255);
  eff_string := '';
  for eff_loop_var in str_buffer1 do StrAdd(eff_string, chr(eff_loop_var));
  Write(Trim(eff_string));
  Writeln;
  Cls(1);
  key := Get(7);
  ReadKey;
end;

begin
  MAINProc;
end.
