'=========================================================================== ' Subject: MD-DOS STANDARD OUTPUT FILTER Date: 01-08-97 (15:27) ' Author: Tyler Barnes Code: QB, PDS ' Origin: comp.lang.basic.misc Packet: DOS.ABC '=========================================================================== 'Hey everyone. Here's one last version of the filter program I made. (I 'hope I didn't post this version already) 'You will notice that I have two different filter "methods" ... The '"EASY" method worked in my old version, but the "COMPLICATED" version 'did not because I didn't have any of the file handling SUBs created. I 'expected you could just use BASIC's file handling routines. 'Unfortunatly, BASIC's routines mess with the MSDOS cursor so I had to 'make my own custom file-handling routines to handle the second filter 'method. Here it is: DECLARE FUNCTION REPLACE$ (T$, S$, R$) DECLARE SUB StandardOutput (ST$) DECLARE FUNCTION ReadFile$ (Bytes%) DECLARE FUNCTION FileExist% (T$) DECLARE FUNCTION StandardInput$ () DECLARE SUB OpenFile (File$, Mode$) DECLARE SUB WriteFile (DTW$) DECLARE SUB CloseFile () '$INCLUDE: '\basic\bc\qb.bi' DIM SHARED InregX AS RegTypeX, OutregX AS RegTypeX ' __________________________________________________________________________ '| MS-DOS Standard Output Filter | '| By D. Tyler Barnes | '| | '| This program allows you to create a standard output filter such | '| as MORE.COM and SORT.EXE, two programs that come with MS-DOS. It allows | '| you to pipe information to your program from the command line and modify | '| the information before sending it to standard output. | '| | '| Note: This version of FILTER.BAS has custom file handling routines | '| because BASIC's inbuilt file handling routines mess with the DOS | '| cursor. That was messing things up pretty badly in the previous | '| version. | '| | '| Example Usage: DIR /w |Filter | '| Example #2: Filter