home *** CD-ROM | disk | FTP | other *** search
- { ╔═══╦══════════════════════════════════════════════╦═══╗
- ║ ║ Pascal Library by Scott Wade ║ ║
- ║ ║ 715 FM 1959 Apt 310 ║ ║
- ║ ║ Houston, TX 77034 ║ ║
- ┌──────╨───╨──────────────────────────────────────────────╨───╨──────┐
- │ This group of routines is contributed to public domain, and no │
- │ one can possibly get any commercial value out of them since they │
- │ must be used in other programs. I require that if these are used │
- │ as is in any program, that this banner remain with the source │
- │ code of the program. I would appreciate any comments or sugges- │
- │ tions on improvements, & am curious to hear how these are used. │
- │ You can leave a message for me on these BBS's: │
- │ Ziggy's 821-1391 ScoreBoard 583-7848 │
- │ TBL-COMM 661-9040 Test-Mode 660-9252 │
- └────────────────────────────────────────────────────────────────────┘
-
- XCOMMAND.LIB Startup & Parameter parsing Library.
- v2.2: 9/27/85 : eliminated useless proc xFnmParse, cleaned up & documented
- it better, constructed xCommand.TST and removed TST module from
- LIB file.
-
- > xCommand( var Parms : buffer );
- fetches the parameters used in the start keyin for the COM file. This
- must be executed before any other statement in the program!
- > xCmdParse( CmdParm : buffer ; Command Line input.
- var CmdList : longwordlist; array of parameters output.
- var TotalParms : Integer ); number of parameters output.
- Parses command line and returns an array containing all parms.
- }
-
- procedure xCommand( var Parms : buffer );{
- This must be the first procedure executed in the program!!! otherwise only
- the first 32 characters are returned properly. }
-
- var
- CmdBuffr : buffer absolute cseg:$80 ;
- begin
- Parms := Copy( CmdBuffr, 2,Length(cmdBuffr));
- end{ Command };
-
- procedure XCmdParse( CmdParm : buffer ;
- var CmdList : LongWordList;
- var TotalParms : Integer );
- var
- ParmLength, CommaPos : integer ;
- OneParm : LongWord ;
- begin
- TotalParms := 1 ;
- ParmLength := Length( CmdParm );
-
- If ParmLength > 2 then begin
- While Pos(',', CmdParm) > 0 do begin
- CommaPos := Pos(',', CmdParm);
- OneParm := copy( CmdParm, 1, CommaPos -1);
- CmdList[ TotalParms ] := OneParm ;
- TotalParms := Succ(TotalParms);
- Delete( CmdParm, 1, CommaPos);
- end{ while };
- end{ If ParmLength };
-
- CMdList[ TotalParms ] := CmdParm ;
- end{ XCmdParse };
- { end xCommand.LIB
- *****************************************************************************}