+ Made AddDisk a function, returning the current number of drives.

git-svn-id: trunk@3816 -
This commit is contained in:
michael 2006-06-06 20:54:21 +00:00
parent 77a7476620
commit e73bc0b772
2 changed files with 7 additions and 5 deletions

View File

@ -51,7 +51,7 @@ Procedure UnixDateToDt(SecsPast: LongInt; Var Dt: DateTime);
Function DTToUnixDate(DT: DateTime): LongInt;
{Disk}
Procedure AddDisk(const path:string);
Function AddDisk(const path:string) : byte;
Implementation
@ -384,7 +384,7 @@ const
var
DriveStr : array[4..26] of pchar;
Procedure AddDisk(const path:string);
Function AddDisk(const path:string) : byte;
begin
if not (DriveStr[Drives]=nil) then
FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
@ -392,7 +392,8 @@ begin
StrPCopy(DriveStr[Drives],path);
inc(Drives);
if Drives>26 then
Drives:=4;
Drives:=4;
AddDisk:=Drives;
end;

View File

@ -38,7 +38,7 @@ uses
{ Include platform independent interface part }
{$i sysutilh.inc}
Procedure AddDisk(const path:string);
Function AddDisk(const path:string) : Byte;
{ the following is Kylix compatibility stuff, it should be moved to a
special compatibilty unit (FK) }
@ -717,7 +717,7 @@ var
Drives : byte;
DriveStr : array[4..26] of pchar;
Procedure AddDisk(const path:string);
Function AddDisk(const path:string) : Byte;
begin
if not (DriveStr[Drives]=nil) then
FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
@ -726,6 +726,7 @@ begin
inc(Drives);
if Drives>26 then
Drives:=4;
Result:=Drives;
end;