From: Ross_Boyd@tnt.com.au
Hi all,
Maybe someone is interested in this.
Last night I was experimenting with a function to return a list of
valid drives and came across this little gem.
There is a function GetNextConnection() which will give you a list of
valid drives like this:
--------------------------------------------------------------------------
string proc GetDriveString()
string drive[20] = ""
string drivestr[80] = ""
while GetNextConnection(drive)
drivestr = drivestr + drive + " "
endwhile
return(drivestr)
end
proc Main()
Warn("DriveList=",GetDriveString())
end
---------------------------------------------------------------------------
integer proc GetNextConnection(drive) sequentially sets the passed
string variable to the drive letter including colon.
It returns false/0 when there are no more drives (at which point it
begins again at the first valid drive).
Also, it skips the logical floppy B: drive (if you only have one floppy
A: drive)
See example above.
It's _much_ faster than testing the return of LogDrive('a' to 'z') in a loop.
I think its limited to TSE 2.8b although I haven't actually checked.
Hope this is of use to someone.
Cheers,
Ross
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|