home *** CD-ROM | disk | FTP | other *** search
- {$M 40000,16000,16000}
-
- Program ViewAnsi;
-
- uses
-
- vtypesu,
- vcrtu,
- dos,
- vdoshu,
- VAnsiiou,
- VAvtiou,
- voutu;
-
- Var
-
- F : FILE;
- CH : CHAR;
-
- Buff : String;
-
- numread : word;
-
- finfo : searchrec;
-
-
- BEGIN
-
- { attach the ansi and avatar filters to the CRT channel }
-
- VOutFilterAttach( CrtOCH,
- 0,
- 'ANSIFILTER',
- 'Bx00VMEM',
- AnsiFilter,
- 0,0,0 );
-
- VOutFilterAttach( CrtOCH,
- 0,
- 'AVTFILTER',
- 'Bx00VMEM',
- AvatarFilter,
- 0,0,0 );
-
-
- If ParamCount>0 Then
- BEGIN
-
- { get the first file }
-
- FindFirst( ParamStr(1), archive, Finfo );
-
- While DosError=0 Do
- BEGIN
-
- ClrScr;
-
- { open the file }
-
- Assign( F, GetDirFromPath( ParamStr(1) )+FInfo.Name );
- Reset( F,1 );
-
- While Not Eof( F ) Do
- BEGIN
-
- { read in a block }
-
- BlockRead( F, buff[1], 128, numread );
-
- buff[0]:=chr(numread);
-
- { write it to the screen }
-
- Write( Buff );
-
- END;
-
- { close this file and try the next }
-
- Close( F );
-
- FindNext( Finfo );
-
- END; { while doserror=0 }
-
- END
- ELSE
- BEGIN
-
- WriteLn;
- WriteLn('ViewAnsi - Ansi & Avatar File display program');
- WriteLn('A Demo from the VisionTools for Pascal library package.');
- WriteLn('Verson 0.9; December 28, 1993');
- WriteLn;
- WriteLn('Usage: ViewAnsi filename (filename can include wildcards)');
- WriteLn;
-
- END;
-
- END.
-