Category : Modula II Source Code
Archive   : BLOCKIO.ZIP
Filename : BLOCKTST.MOD

 
Output of file : BLOCKTST.MOD contained in archive : BLOCKIO.ZIP


MODULE blocktest;
(* Program for testing the procedures in the blockio module.
*)

FROM blockio IMPORT
(* proc *) openinput, resetinput, getnextchar,
backupinput, openoutput, closeoutput,
putchar, backupoutput;

FROM InOut IMPORT
(* proc *) Write, WriteLn, WriteString, Read;

VAR
i : CARDINAL;
ch : CHAR;
c : CHAR;

BEGIN
Write( CHR( 12 ) ); (* Form feed for clearing screen *)
openinput( "test.txt" );
openoutput( "out.txt" );
WriteString(
" Blockio Test Program" );
WriteLn;
WriteLn;
WriteString(
"Instructions: Hit Any Key To Proceed With Each Step."
);
WriteLn;
WriteString(
"-------------------------------------------------" )
;
WriteString( "----------------------------" );
WriteLn;
WriteLn;
WriteString(
"Get 805 characters of test.txt and put them in out.txt --"
);
WriteLn;
WriteLn;
Read( c );
FOR i := 1 TO 805 DO
getnextchar( ch );
Write( ch );
putchar( ch );
END (* for i *);
WriteLn;
WriteLn;
WriteString( "Back up 15 characters in the output --" );
WriteLn;
WriteLn;
Read( c );
FOR i := 1 TO 15 DO
backupoutput;
END (* for loop *);
WriteString(
"Put the characters a, b, and c in the output --" );
WriteLn;
WriteLn;
Read( c );
putchar( 'a' );
putchar( 'b' );
putchar( 'c' );
WriteString(
"Reset the input file to the beginning and then " );
WriteString( "get and backup 50 times --" );
WriteLn;
WriteLn;
Read( c );
resetinput;
FOR i := 1 TO 50 DO
getnextchar( ch );
Write( ch );
backupinput;
END (* for loop *);
WriteLn;
WriteLn;
WriteString( "Get 805 characters from the input file --" )
;
WriteLn;
WriteLn;
Read( c );
FOR i := 1 TO 805 DO
getnextchar( ch );
Write( ch );
END (* for loop *);
WriteLn;
WriteLn;
WriteString( "Back up 15 characters in the input file --"
);
WriteLn;
WriteLn;
Read( c );
FOR i := 1 TO 15 DO
backupinput;
END (* for loop *);
WriteString( "Get 900 characters from the input file --" )
;
WriteLn;
WriteLn;
Read( c );
FOR i := 1 TO 900 DO
getnextchar( ch );
Write( ch );
END (* for loop *);
WriteLn;
WriteLn;
WriteString(
"Put the characters 8, 7, 6, 5, and 1 in the " );
WriteString( "output file and close it --" );
WriteLn;
WriteLn;
Read( c );
putchar( "8" );
putchar( "7" );
putchar( "6" );
putchar( "5" );
putchar( "1" );
closeoutput;
END blocktest.

  3 Responses to “Category : Modula II Source Code
Archive   : BLOCKIO.ZIP
Filename : BLOCKTST.MOD

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/