Quote: "again 0 is for your local drive, where your app is running
this is not problem, the problem exist if you have various partitions in the disk. example 1 fisical drive and 3 partitions fat32 C:\ d:\ e:\
print GET DRIVE TOTAL SIZE( 0, 1 )
print GET DRIVE TOTAL SIZE( 2, 1 )
print GET DRIVE TOTAL SIZE( 3, 1 )"
I see. Well, the partitions are stored as logical drives so their information would read as if they were physical drives. It may not be the case with the enhancement pack - I don't really know, but I think it would be.
Quote: ""The parameter "Drive ID" is the index of the drive you want to check.""
If this is true, then I would guess that the index numbers starting from 1, represent each letter in order. If you use index 0, that means read the current drive for the current directory. It could be anything if you use zero.
To test, try
perform checklist for drives
for d=1 to checklist quantity()
print d
print checklist string$(d)
next d
That will get your drive letters and hopefully the index of each drive. Then try
for d=1 to checklist quantity()
print GET DRIVE TOTAL SIZE( d, 1 )
next d
Use your windows file explorer to compare the sizes. If they match, then you know what the relationship between the indexes and the letters are.
If they match, then your function might look like:
function TotalSpace(drive$)
result=0
rem get the drive letters
perform checklist for drives
for d=1 to checklist quantity()
if lower$(drive$)=lower$(checklist string$(d))
result=GET DRIVE TOTAL SIZE( d, 1 )
exit
endif
next d
endfunction result
Quote: "But not works... error line 17
Run time error - index number illegal at line 17
call dll kernel32,"GetDiskFreeSpaceExA",drive$,ptr,ptr+8,ptr+16
"
That's strange. It works here - but I have a pretty old computer and that code is for DBC. That code lists the drive letter and gives the memory for the drive.
I don't know what the index is that is illegal. Maybe try changing
ptr=get memblock ptr(1)
call dll kernel32,"GetDiskFreeSpaceExA",drive$,ptr,ptr+8,ptr+16
to
ptr1=get memblock ptr(1)
ptr2=ptr1+8
ptr3=ptr1+16
call dll kernel32,"GetDiskFreeSpaceExA",drive$,ptr1,ptr2,ptr3
Enjoy your day.