mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 12:49:33 +02:00
+ Made AddDisk a function, returning the current number of drives.
git-svn-id: trunk@3816 -
This commit is contained in:
parent
77a7476620
commit
e73bc0b772
@ -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;
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user