home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
LANGUAGS
/
PASCAL
/
PPAS80.LBR
/
ARGTEST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
2000-06-30
|
768b
|
24 lines
program ArgTest (f, output);
(* test ArgLib module, used to get file names from command line *)
const maxarg = 20;
var f: text;
(*$I arglib.pas IMPORT argc, argv, ArgStrType *)
procedure GetArguments;
var
nFiles,j : integer;
arga: array [0..maxarg] of ArgStrType;
begin
nFiles := argc-1; if nFiles > maxarg then nFiles := maxarg;
for j := 0 to nFiles do argv(j,arga[j]);
writeln('argc=',(nFiles+1):1,' file arguments=',nFiles:1);
for j:= 0 to nFiles do
begin write( j:2, ' = ',arga[j]);
if resetOK(f,arga[j]) then writeln(' exists') else writeln(' empty');
end;
end;
begin (* ArgTest *)
GetArguments
end.