Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drive A

Status
Not open for further replies.

dardapu

Programmer
Sep 10, 2002
67
0
0
Do I need to control if a diskette exists in the drive TO before carrying out its use, is there some form of making it with a command of visual or an external library?.
Thank you
 
if DiskSpace("A:")>0 &&or space>file
*then copy
else
messagebox("Insert Disk with enough space")&&and windows error returned for you too
endif
 
I have proven this sentence and in Visual 3 respond me there are too many parameters...
 
I do not have FoxPro 3, but I'd recommend looking in the help file for diskspace().

Or, if you have filescripting installed:

objFSO = CreateObject("Scripting.FileSystemObject")
colDrives = objFSO.Drives

For Each objDrive in colDrives
?"Drive letter: " + objDrive.DriveLetter
?"Drive Status: " + TRANSFORM(objDrive.IsReady)
IF objDrive.IsReady=.t.
?"Free Space: " + TRANSFORM(objDrive.AvailableSpace)
ENDIF

IF objDrive.DriveLetter="A" AND objDrive.IsReady=.t. and objDrive.AvailableSpace>0
*COPY
ELSE
MESSAGEBOX("Floppy Problem")
ENDIF
NEXT
 
Yes, in VFP 3.0, DISKSPACE() had no parameters - it only worked on the default drive. If you SET DEFAULT TO "A:\", then depending on the OS and it's configuration you'll get some kind of error if there is nothing in that drive! (Definitely self defeating for what you are trying to do!)

You really need to move away from VFP 3.0 - it's very primitive and flaky compared to 7.0/8.0.

Rick


 
It is that I need to make an application in this version for the type of Pc where installed anger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top