home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MADTRB4.ZIP / PARAMETR.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1984-12-18  |  1.2 KB  |  34 lines

  1. {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2. The purchaser of these procedures and functions may include them in COMPILED
  3. programs freely, but may not sell or give away the source text.
  4.  
  5.      NOTE: IMPORTANT -- this program is no use unless it is COMPILED.
  6.      When it is compiled, whatever you type on the command line AFTER
  7.      the program name will be picked up by the function GetParameters.
  8.      Your program can then manipulate the parameters in any way you
  9.      wish.  In this example, any backSlashes in the parameter string
  10.      are considered to divide it up.
  11. }
  12. {$I parametr.lib}
  13. var
  14.   TheseParameters : CommandLine;
  15.   OneParameter    : CommandLine;
  16. begin
  17.   WriteLn; WriteLn;
  18.   WriteLn('These are the parameters passed on the command line:');
  19.   TheseParameters := GetParameters;
  20.   repeat
  21.     if pos('/',TheseParameters) <> 0 then
  22.       begin
  23.         OneParameter := copy(TheseParameters,1,pos('/',TheseParameters)-1);
  24.         delete(TheseParameters,1,pos('/',theseParameters));
  25.       end
  26.     else
  27.       begin
  28.         OneParameter := TheseParameters;
  29.         TheseParameters := '';
  30.       end;
  31.     WriteLn(OneParameter);
  32.   until TheseParameters = '';
  33. end.
  34.