On 30 Oct 24 07:07:35, Tiny said the following to All:
Does anyone have an example of pascal source code to just display the contents of a directory? I can do it with a shell to dir /b d:\blah but looking for a way that I could make pretty.
Yes.
program dirthis;
uses dos;
var dirinfo : SearchRec;
this : string;
procedure DirThisFile;
begin
writeln(dirinfo.name);
end;
begin
writeln('Dir "This" Win32 Copyright (c) by Nick J. Andre, Ltd.');
writeln;
this:=paramstr(1);
if (pos('\',this)=0) or (this[length(this)]<>'\') then this:=this+'\';
if (pos('.',this)=0) and (pos('*',this)=0) then this:=this+'*.*';
findfirst(this,archive,dirinfo);
if DOSerror=0 then DirThisFile;
while (DOSerror=0) do
begin
findnext(dirinfo);DirThisFile;
end;
findclose(dirinfo);
end.
Nick
--- Renegade vY2Ka2
* Origin: Joey, do you like movies about gladiators? (618:500/24)