home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / pascal / IOFUNC.ZIP / XCOMMAND.TST < prev    next >
Encoding:
Text File  |  1986-04-12  |  2.5 KB  |  55 lines

  1. {           ╔═══╦══════════════════════════════════════════════╦═══╗
  2.             ║   ║         Pascal Library by Scott Wade         ║   ║
  3.             ║   ║           715 FM 1959      Apt 310           ║   ║
  4.             ║   ║           Houston, TX 77034                  ║   ║
  5.      ┌──────╨───╨──────────────────────────────────────────────╨───╨──────┐
  6.      │  This  group of routines is contributed to public domain,  and no  │
  7.      │  one can possibly get any commercial value out of them since they  │
  8.      │  must be used in other programs. I require that if these are used  │
  9.      │  as is in  any  program,  that this banner remain with the source  │
  10.      │  code of the program.  I would appreciate any comments or sugges-  │
  11.      │  tions on improvements, & am curious to hear how these are used.   │
  12.      │  You can leave a message for me on these BBS's:                    │
  13.      │          Ziggy's  821-1391         ScoreBoard  583-7848            │
  14.      │          TBL-COMM 661-9040         Test-Mode   660-9252            │
  15.      └────────────────────────────────────────────────────────────────────┘
  16.  v1.0 xCommand.TST  test of   Startup & Parameter parsing Library.
  17. > xCommand( var Parms : buffer );
  18.            ;  fetches the parameters used in the start keyin for the COM file.
  19.               This must be executed before any other statement in the program!
  20.  
  21. > xCmdParse(      CmdParm    : buffer ;         Command Line input.
  22.              var  CmdList    : longwordlist;    array of parameters output.
  23.              var  TotalParms : Integer );       number of parameters output.
  24.  
  25.             ; Parses command line and returns an array containing all parms.
  26. }
  27.  
  28. type Buffer       =  string[ 255 ];
  29.      LongWord     =  string[  20 ];
  30.      Word         =  string[  10 ];
  31.      LongWordList =  array[ 1..16 ] of LongWord ;
  32.      WordList     =  array[ 1..16 ] of Word ;
  33.  
  34. var CmdParmsBfr          : Buffer ;
  35.     CmdParmList          : LongWordList;
  36.     LongWordvar          : LongWord ;
  37.     Counter, ParmCOunt   : Integer  ;
  38.  
  39. {$I xCommand.lib }
  40.  
  41. begin
  42.    FILLCHAR( CMDPARMSBFR,255,0);  Parmcount := 0;
  43.    FILLCHAR( CMDPARMLIST,320,0);  Counter   := 0;
  44.    GoToXY( 1,10 );
  45.    writeln('Test of xCommand.LIB v2.3');
  46.    xCommand( CmdParmsBfr );
  47.    writeln( Length(CmdParmsBfr):3,'   |',CmdParmsBfr,'|' );
  48.  
  49.    xCmdParse( CmdParmsBfr, CmdParmList, ParmCount );
  50.  
  51.    For Counter := 1 to ParmCount do begin
  52.       LongWordVar := CmdParmList[ Counter ];
  53.       writeln( Length( LongWordVar):3, '   |',LongWordVar,'|'  );
  54.    end{ For Counter }
  55. end.