[fpc-devel]AddDisk not declared in interface-part!!
Matthias Leonhardt
i7lema at rz.uni-jena.de
Mon Apr 30 08:03:40 CEST 2001
Hello fpc-developers,
Today I couldn't use the AddDisk-Function in the SysUtils-Unit like
described
in the help. It's implemented in the implementation-part of SysUtils.pp
but not declared in the diskh.inc in the interface-part.
It would be great, if I could use it to call Diskfree...
In the help (1.0.2) it is declared as a function in sysutils.pp as a
procedure - IMO it would be better as a function.
Tested with the fixes_1_0_0-branch in linux.
I attached my cvs-diff, which works nice here.
bye, Matthias
-------------- next part --------------
Index: rtl/objpas/diskh.inc
===================================================================
RCS file: /FPC/CVS/fpc/rtl/objpas/diskh.inc,v
retrieving revision 1.1
diff -u -r1.1 diskh.inc
--- rtl/objpas/diskh.inc 2000/07/13 06:30:59 1.1
+++ rtl/objpas/diskh.inc 2001/04/28 15:19:19
@@ -25,6 +25,7 @@
Function SetCurrentDir (Const NewDir : String) : Boolean;
Function CreateDir (Const NewDir : String) : Boolean;
Function RemoveDir (Const Dir : String) : Boolean;
+Function AddDisk (const path : String): Byte;
{
$Log: diskh.inc,v $
Index: rtl/unix/sysutils.pp
===================================================================
RCS file: /FPC/CVS/fpc/rtl/unix/sysutils.pp,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 sysutils.pp
--- rtl/unix/sysutils.pp 2001/02/22 22:17:41 1.1.2.6
+++ rtl/unix/sysutils.pp 2001/04/28 15:19:20
@@ -321,16 +321,17 @@
'/fd1/.',
'/.'
);
+ Drives : byte = 4;
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);
GetMem(DriveStr[Drives],length(Path)+1);
StrPCopy(DriveStr[Drives],path);
+ Result := Drives;
inc(Drives);
if Drives>26 then
Drives:=4;
More information about the fpc-devel
mailing list