Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is Disk In?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00057561
Message ID:
00057590
Views:
25
>Previously in FoxPro V2.6 DOS, I used a wonderful utility ISDISKIN.BIN to check if the selected floppy drive had an actual disk in it. Now in VFP (v3.0a), I am informed that the CALL statement is no longer supported.
>
>Does anyone know of aan alternative in VFP to check if a disk is in a drive?
>
>In addition, is there any simple way to get a list of all drives available on a user's computer?
>
>Thanx...Rex

Last things first. The following API declaration will return a bit map which shows which drives are in use:

DECLARE INTEGER GetLogicalDrives IN Win32API

The following call stores the map in a variable:

lndrivemap = GetLogicalDrives()

Once this is done:

lldriveexists = BITTEST(lndrivemap, 0)

Will return a logical value as to whether or not the drive is present. A: = 0, B: = 1, etc.

To determine the type, you can use the FOXTOOLS library function DriveType( ) to determine the type. See FOXTOOLS.HLP for a description on how to use this function.

You then use the DISKSPACE() function if a disk in the drive. If it isn't, -1 is returned.

hth,

George
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform