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.