Function Left(S : string;Size : byte; Pad : char):string;
var temp : string;
begin
Fillchar(Temp[1],Size,Pad);
Temp[0] := chr(Size);
If Length(S) <= Size then
Move(S[1],Temp[1],length(S))
else
Move(S[1],Temp[1],size);
Left := Temp;
end;
Function Center(S : string;Size : byte; Pad : char):string;
var
temp : string;
L : byte;
begin
Fillchar(Temp[1],Size,Pad);
Temp[0] := chr(Size);
L := length(S);
If L <= Size then
Move(S[1],Temp[((Size - L) div 2) + 1],L)
else
Move(S[((L - Size) div 2) + 1],Temp[1],Size);
Center := temp;
end; {center}
Function Int_to_Str(I : Longint):string;
var S : string[11];
begin
Str(I,S);
Int_to_Str := S;
end;
Function CalcCol(Entry : byte) : byte;
{ returns the display column of the file}
begin
CalcCol := Succ(Pred(Entry) MOD D.cols);
end;
Function CalcRow(Entry : byte) : byte;
{ returns the display row of the file}
begin
CalcRow := Pred(Entry + D.cols) DIV D.cols;
end;
Function Subdirectory(Attrib:byte): boolean;
begin
Subdirectory := ((Attrib and 16) = 16);
end;
Function ValidPathName:Boolean;
begin
If PathName[Length(PathName)] <> '\' then
PathName := PathName + '\';
{$I-}
If (length(PathName) = 3) and (PathName[2] = ':') then
Chdir(PathName)
else
ChDir(copy(Pathname,1,length(Pathname) - 1));
{$I+}
ValidPathName := (IoResult = 0);
end; {ValidPathName}
Function FileDetails(F:FileRecord):string;
var
DT : DateTime;
Str: string;
begin
UnPackTime(F.Time,DT);
Str := Int_to_Str(F.Size)+' '
+Int_to_Str(DT.Month)+'-'+Int_to_Str(DT.Day)+'-'
+copy(Int_to_Str(DT.Year),3,2)
+' '+Int_To_Str(DT.Hour)+':'+Int_to_Str(DT.Min);
FileDetails := Str;
end;
Function ExtractPrevDir(Path : string): string;
begin
Repeat
Delete(Path,length(Path),1);
Until ( copy(Path,length(Path),1) = '\') or (length(Path) = 0);
Delete(Path,length(Path),1);
If length(Path) > 2 then
ExtractPrevDir := Path0)string;string;sd d d;
;
;wswsw((L((L(FUFUFeft(chrchar(mp[mp[m 'r r r TLef┬TITITY imto_Se -cur /$4 /$4 B B B;
v;
v;AnAnAed Xtra : byte;
begin
If D.DateTime then
ra := 1
else
a := 0;
If D.
IfTime and (D.cols < 4) then n ns := 4; s s .colsolso 1) or (D(D( 1) > 6) then D.cols := 6;:= 0:= 0:Rows or1)s := 6 := 6 FUFxt (D> 23) then D. D. := 23 - - a;