Discussion:
Check Floppy Disk
(too old to reply)
HerbertDB
2008-12-05 07:53:23 UTC
Permalink
Hi,

How can I check if there is a Floppy Disk
inside a Floppy Drive without generating
a "No Disk" error from VFP?


Thanks,
herbert
Mark Burgum
2008-12-05 08:14:26 UTC
Permalink
i very much doubt that you can, however you can use try catch or a local on
error routine to trap the error. this seems to be the only way to deal with
this sort of problem.
Post by HerbertDB
Hi,
How can I check if there is a Floppy Disk
inside a Floppy Drive without generating
a "No Disk" error from VFP?
Thanks,
herbert
Olaf Doschke
2008-12-05 08:20:16 UTC
Permalink
Without having a floppy disc drive
from the descriptions of the filesystemobject
this should work:

Local loFSO, llExists, llReady

loFSO = CreateObject("Scripting.Filesystemobject")
llExists = loFSO.DriveExists("A")
If llExists
llReady = loFSO.Drives("A").IsReady
Endif

If a disc is inserted llReady should be true.

Bye, Olaf.
Olaf Doschke
2008-12-05 08:30:36 UTC
Permalink
Post by Olaf Doschke
Without having a floppy disc drive
Tested with the CD drive, it's working
for that. No Disc: llREade is false, Disc
inserted, llReady is true.

Bye, Olaf.
HerbertDB
2008-12-05 08:46:58 UTC
Permalink
Hi Olaf,

Thanks for the reply. Will try your sample
Post by Olaf Doschke
Post by Olaf Doschke
Without having a floppy disc drive
Tested with the CD drive, it's working
for that. No Disc: llREade is false, Disc
inserted, llReady is true.
Bye, Olaf.
HerbertDB
2008-12-05 08:51:44 UTC
Permalink
Hi again,

The sample works great with a Floopy Drive.

Thanks Olaf.
Post by HerbertDB
Hi Olaf,
Thanks for the reply. Will try your sample
Post by Olaf Doschke
Post by Olaf Doschke
Without having a floppy disc drive
Tested with the CD drive, it's working
for that. No Disc: llREade is false, Disc
inserted, llReady is true.
Bye, Olaf.
felix federowicz
2011-01-20 14:47:02 UTC
Permalink
Olaf,

I found this solution while surfing the net and have found it useful so thank you.

However I am looking for another solution. I have a foxpro application that calls a DLL that sends records to a SQL databse on a remote server. Once the DLL is fired up I have no way of interuppting foxpro via nay command button on the form.

Any ideas would be appreciated.

Regrds

Felix

Local loFSO, llExists, llReady

loFSO = CreateObject("Scripting.Filesystemobject")
llExists = loFSO.DriveExists("A")
If llExists
llReady = loFSO.Drives("A").IsReady
Endif

If a disc is inserted llReady should be true.
Post by HerbertDB
Hi,
How can I check if there is a Floppy Disk
inside a Floppy Drive without generating
a "No Disk" error from VFP?
Thanks,
herbert
Post by Mark Burgum
i very much doubt that you can, however you can use try catch or a local on
error routine to trap the error. this seems to be the only way to deal with
this sort of problem.
Post by Olaf Doschke
Without having a floppy disc drive
from the descriptions of the filesystemobject
Local loFSO, llExists, llReady
loFSO = CreateObject("Scripting.Filesystemobject")
llExists = loFSO.DriveExists("A")
If llExists
llReady = loFSO.Drives("A").IsReady
Endif
If a disc is inserted llReady should be true.
Bye, Olaf.
Tested with the CD drive, it is working
for that. No Disc: llREade is false, Disc
inserted, llReady is true.
Bye, Olaf.
Post by HerbertDB
Hi Olaf,
Thanks for the reply. Will try your sample
Post by HerbertDB
Hi again,
The sample works great with a Floopy Drive.
Thanks Olaf.
Post by swdev2
Olaf - yer so baaaaaaaaaaad !!! I'm now thinking to purchase you a USB
external floppy drive for xMas... With VFP Logo painted on the sides..
GuFen xMas !!! [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by HerbertDB
Hi Olaf,
Just wondering what is your programming specialty
and what book do you suggest I read to know
more about the codes you just gave.
Thanks!
Post by MikeA
? diskspace("a")
will return -1 (at least in VFP 9 but seems to error out in VFP 6, not sure
about 7 and 8 though)
? diskspace("a") where we will assume A is the volume for the floppy drive
otherwise you could try diskspace("b") etc.
Mike
Post by Olaf Doschke
My specialty is Foxpro of course.
But if you prefoessionally do maintain some large
applications side knowledge of the Windows API
and other system tools just automatically creeps in.
If you hang around forums like me, you'll learn such
things as helpful COM classes like Scripting
Filesystemobject as side notes.
I really can't recommend a book here, you'll find
plenty resources in the internet.
I haven't learned that from a book, I just remembered
dimly there were Drive subobjects you could get from
FSO, and then used Intellisense to explore it's
properties and features.
I'm more the autodidactic type, more learning by
doing than learning from books, lectures or lessons.
Still I could recommend in general, that there is
much more VFP can do, if you take advantage of
the resources that are there for everyone from the
windows API and similar OS stuff lying around.
Regarding the API the best resource for VFP programmers
is www.news2news.com
The advantage is of course you get the DECLARE code you
need. Nevertheless the better reference ragarding parameters
and usage often is the MSDN library
http://msdn.microsoft.com/en-us/library/default.aspx
FSO is just a little aspect of scripting, but it's not
_the_ scripting engine, it's just a COM helper
object you can use in VFP or any other COM
capable language too. And it can't be turned off,
it's a COM Server, if it's in the registry it's in the
registry and available.
http://msdn.microsoft.com/en-us/library/hww8txat(VS.85).aspx
Bye, Olaf.
Post by Man-wai Chang ToDie (33.6k)
parameter m.path
private m.xx, m.yy
m.yy=alltrim(m.path)
if right(m.yy,1)!="\"
m.yy = m.yy+"\"
endif
m.yy=m.yy+sys(3)+".TMP"
if file("STOPERR.BIN")
* thanks goes to an internet user
* this routine can stop DOS error from interrupting the FoxPro
* program, producing ulgy screen!
if !"WINDOW"$upper(version())
load STOPERR
call STOPERR
endif
endif
m.xx=fcreate(m.yy)
if m.xx > 0
=fclose(m.xx)
erase (m.yy)
return .t.
endif
if file("STOPERR.BIN")
if !"WINDOW"$upper(version())
release STOPERR
endif
endif
return .f.
--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04.1) Linux 2.6.26.8
^ ^ 14:48:01 up 25 days 3:02 3 users load average: 1.04 1.04 1.01
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
Post by Paul Pedersen
What's a floppy disk?
Post by HerbertDB
LOL
We still use them here in the Philippines, Gov't Offices
uses them. And Flash Drives are more cheaper than a
1 box of Floppy Disk. I cant move away from Floppy
Drives becoz we use them in Gov't remittances.
Post by Man-wai Chang ToDie (33.6k)
Vi$ta's installation program (WINPE) could read drivers off a USB drive
or a NTFS partition. The need for floppy diskette disk would be gone
soon....
--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04.1) Linux 2.6.26.8
^ ^ 17:13:01 up 26 days 5:27 3 users load average: 1.02 1.07 1.02
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
Post by tom knauf
Hi,
Thats where you put your sata drivers for xp (yes I know Nlite)
and your bank keyfile for HCBI access (no, no usb in company edition)
Tom
(never buy a pc without it)
Post by Olaf Doschke
An application we maintain still uses
floppy disks to transfer smaller amounts
of data, alternatively it can be done
via USB stick or by serial cable.
The new version we work on will only
support USB or (W)LAN datatransfer.
It's not that far out to still use
floppies. Fast enough to store/read
100k or so temporarily.
Bye, Olaf.
Submitted via EggHeadCafe
ASP.NET Generic Cookie Utility Class
http://www.eggheadcafe.com/tutorials/aspnet/e7108c33-1cc6-48ae-9f65-cc391c8b66a7/aspnet-generic-cookie-utility-class.aspx
swdev2
2008-12-05 19:34:53 UTC
Permalink
Olaf - yer so baaaaaaaaaaad !!! I'm now thinking to purchase you a USB
external floppy drive for xMas... With VFP Logo painted on the sides..

GuFen xMas !!! [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by Olaf Doschke
Without having a floppy disc drive
Olaf Doschke
2008-12-10 13:17:56 UTC
Permalink
An application we maintain still uses
floppy disks to transfer smaller amounts
of data, alternatively it can be done
via USB stick or by serial cable.

The new version we work on will only
support USB or (W)LAN datatransfer.

It's not that far out to still use
floppies. Fast enough to store/read
100k or so temporarily.

Bye, Olaf.
felix federowicz
2011-01-20 14:48:57 UTC
Permalink
Olaf,



I found this solution while surfing the net and have found it useful so thank you.



However I am looking for another solution. I have a foxpro application that calls a DLL that sends records to a SQL databse on a remote server. Once the DLL is fired up I have no way of interuppting foxpro via nay command button on the form.



Any ideas would be appreciated.



Regrds



Felix



Local loFSO, llExists, llReady



loFSO = CreateObject("Scripting.Filesystemobject")

llExists = loFSO.DriveExists("A")

If llExists

llReady = loFSO.Drives("A").IsReady

Endif



If a disc is inserted llReady should be true.
Post by HerbertDB
Hi,
How can I check if there is a Floppy Disk
inside a Floppy Drive without generating
a "No Disk" error from VFP?
Thanks,
herbert
Post by Mark Burgum
i very much doubt that you can, however you can use try catch or a local on
error routine to trap the error. this seems to be the only way to deal with
this sort of problem.
Post by Olaf Doschke
Without having a floppy disc drive
from the descriptions of the filesystemobject
Local loFSO, llExists, llReady
loFSO = CreateObject("Scripting.Filesystemobject")
llExists = loFSO.DriveExists("A")
If llExists
llReady = loFSO.Drives("A").IsReady
Endif
If a disc is inserted llReady should be true.
Bye, Olaf.
Tested with the CD drive, it is working
for that. No Disc: llREade is false, Disc
inserted, llReady is true.
Bye, Olaf.
Post by HerbertDB
Hi Olaf,
Thanks for the reply. Will try your sample
Post by HerbertDB
Hi again,
The sample works great with a Floopy Drive.
Thanks Olaf.
Post by swdev2
Olaf - yer so baaaaaaaaaaad !!! I'm now thinking to purchase you a USB
external floppy drive for xMas... With VFP Logo painted on the sides..
GuFen xMas !!! [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by HerbertDB
Hi Olaf,
Just wondering what is your programming specialty
and what book do you suggest I read to know
more about the codes you just gave.
Thanks!
Post by MikeA
? diskspace("a")
will return -1 (at least in VFP 9 but seems to error out in VFP 6, not sure
about 7 and 8 though)
? diskspace("a") where we will assume A is the volume for the floppy drive
otherwise you could try diskspace("b") etc.
Mike
Post by Olaf Doschke
My specialty is Foxpro of course.
But if you prefoessionally do maintain some large
applications side knowledge of the Windows API
and other system tools just automatically creeps in.
If you hang around forums like me, you'll learn such
things as helpful COM classes like Scripting
Filesystemobject as side notes.
I really can't recommend a book here, you'll find
plenty resources in the internet.
I haven't learned that from a book, I just remembered
dimly there were Drive subobjects you could get from
FSO, and then used Intellisense to explore it's
properties and features.
I'm more the autodidactic type, more learning by
doing than learning from books, lectures or lessons.
Still I could recommend in general, that there is
much more VFP can do, if you take advantage of
the resources that are there for everyone from the
windows API and similar OS stuff lying around.
Regarding the API the best resource for VFP programmers
is www.news2news.com
The advantage is of course you get the DECLARE code you
need. Nevertheless the better reference ragarding parameters
and usage often is the MSDN library
http://msdn.microsoft.com/en-us/library/default.aspx
FSO is just a little aspect of scripting, but it's not
_the_ scripting engine, it's just a COM helper
object you can use in VFP or any other COM
capable language too. And it can't be turned off,
it's a COM Server, if it's in the registry it's in the
registry and available.
http://msdn.microsoft.com/en-us/library/hww8txat(VS.85).aspx
Bye, Olaf.
Post by Man-wai Chang ToDie (33.6k)
parameter m.path
private m.xx, m.yy
m.yy=alltrim(m.path)
if right(m.yy,1)!="\"
m.yy = m.yy+"\"
endif
m.yy=m.yy+sys(3)+".TMP"
if file("STOPERR.BIN")
* thanks goes to an internet user
* this routine can stop DOS error from interrupting the FoxPro
* program, producing ulgy screen!
if !"WINDOW"$upper(version())
load STOPERR
call STOPERR
endif
endif
m.xx=fcreate(m.yy)
if m.xx > 0
=fclose(m.xx)
erase (m.yy)
return .t.
endif
if file("STOPERR.BIN")
if !"WINDOW"$upper(version())
release STOPERR
endif
endif
return .f.
--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04.1) Linux 2.6.26.8
^ ^ 14:48:01 up 25 days 3:02 3 users load average: 1.04 1.04 1.01
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
Post by Paul Pedersen
What's a floppy disk?
Post by HerbertDB
LOL
We still use them here in the Philippines, Gov't Offices
uses them. And Flash Drives are more cheaper than a
1 box of Floppy Disk. I cant move away from Floppy
Drives becoz we use them in Gov't remittances.
Post by Man-wai Chang ToDie (33.6k)
Vi$ta's installation program (WINPE) could read drivers off a USB drive
or a NTFS partition. The need for floppy diskette disk would be gone
soon....
--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04.1) Linux 2.6.26.8
^ ^ 17:13:01 up 26 days 5:27 3 users load average: 1.02 1.07 1.02
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
Post by tom knauf
Hi,
Thats where you put your sata drivers for xp (yes I know Nlite)
and your bank keyfile for HCBI access (no, no usb in company edition)
Tom
(never buy a pc without it)
Post by Olaf Doschke
An application we maintain still uses
floppy disks to transfer smaller amounts
of data, alternatively it can be done
via USB stick or by serial cable.
The new version we work on will only
support USB or (W)LAN datatransfer.
It's not that far out to still use
floppies. Fast enough to store/read
100k or so temporarily.
Bye, Olaf.
Post by felix federowicz
Olaf,
I found this solution while surfing the net and have found it useful so thank you.
However I am looking for another solution. I have a foxpro application that calls a DLL that sends records to a SQL databse on a remote server. Once the DLL is fired up I have no way of interuppting foxpro via nay command button on the form.
Any ideas would be appreciated.
Regrds
Felix
Local loFSO, llExists, llReady
loFSO = CreateObject("Scripting.Filesystemobject")
llExists = loFSO.DriveExists("A")
If llExists
llReady = loFSO.Drives("A").IsReady
Endif
If a disc is inserted llReady should be true.
Submitted via EggHeadCafe
ASP.NET Generic Cookie Utility Class
http://www.eggheadcafe.com/tutorials/aspnet/e7108c33-1cc6-48ae-9f65-cc391c8b66a7/aspnet-generic-cookie-utility-class.aspx
HerbertDB
2008-12-06 01:07:35 UTC
Permalink
Hi Olaf,

Just wondering what is your programming specialty
and what book do you suggest I read to know
more about the codes you just gave.

Thanks!
Post by Olaf Doschke
Without having a floppy disc drive
from the descriptions of the filesystemobject
Local loFSO, llExists, llReady
loFSO = CreateObject("Scripting.Filesystemobject")
llExists = loFSO.DriveExists("A")
If llExists
llReady = loFSO.Drives("A").IsReady
Endif
If a disc is inserted llReady should be true.
Bye, Olaf.
MikeA
2008-12-06 02:29:34 UTC
Permalink
? diskspace("a")

will return -1 (at least in VFP 9 but seems to error out in VFP 6, not sure
about 7 and 8 though)

? diskspace("a") where we will assume A is the volume for the floppy drive
otherwise you could try diskspace("b") etc.

Mike
Post by HerbertDB
Hi Olaf,
Just wondering what is your programming specialty
and what book do you suggest I read to know
more about the codes you just gave.
Thanks!
Post by Olaf Doschke
Without having a floppy disc drive
from the descriptions of the filesystemobject
Local loFSO, llExists, llReady
loFSO = CreateObject("Scripting.Filesystemobject")
llExists = loFSO.DriveExists("A")
If llExists
llReady = loFSO.Drives("A").IsReady
Endif
If a disc is inserted llReady should be true.
Bye, Olaf.
Olaf Doschke
2008-12-06 07:53:59 UTC
Permalink
Post by HerbertDB
Just wondering what is your programming specialty
and what book do you suggest I read to know
more about the codes you just gave.
My specialty is Foxpro of course.
But if you prefoessionally do maintain some large
applications side knowledge of the Windows API
and other system tools just automatically creeps in.

If you hang around forums like me, you'll learn such
things as helpful COM classes like Scripting
Filesystemobject as side notes.

I really can't recommend a book here, you'll find
plenty resources in the internet.

I haven't learned that from a book, I just remembered
dimly there were Drive subobjects you could get from
FSO, and then used Intellisense to explore it's
properties and features.

I'm more the autodidactic type, more learning by
doing than learning from books, lectures or lessons.

Still I could recommend in general, that there is
much more VFP can do, if you take advantage of
the resources that are there for everyone from the
windows API and similar OS stuff lying around.

Regarding the API the best resource for VFP programmers
is www.news2news.com

The advantage is of course you get the DECLARE code you
need. Nevertheless the better reference ragarding parameters
and usage often is the MSDN library
http://msdn.microsoft.com/en-us/library/default.aspx

FSO is just a little aspect of scripting, but it's not
_the_ scripting engine, it's just a COM helper
object you can use in VFP or any other COM
capable language too. And it can't be turned off,
it's a COM Server, if it's in the registry it's in the
registry and available.

http://msdn.microsoft.com/en-us/library/hww8txat(VS.85).aspx

Bye, Olaf.
Man-wai Chang ToDie (33.6k)
2008-12-07 06:53:13 UTC
Permalink
Post by HerbertDB
Hi,
How can I check if there is a Floppy Disk
inside a Floppy Drive without generating
a "No Disk" error from VFP?
Back in the days of DOS:

***@server:~/xx$ cat WRITABLE.PRG
parameter m.path
private m.xx, m.yy
m.yy=alltrim(m.path)
if right(m.yy,1)!="\"
m.yy = m.yy+"\"
endif
m.yy=m.yy+sys(3)+".TMP"
if file("STOPERR.BIN")
* thanks goes to an internet user
* this routine can stop DOS error from interrupting the FoxPro
* program, producing ulgy screen!
if !"WINDOW"$upper(version())
load STOPERR
call STOPERR
endif
endif
m.xx=fcreate(m.yy)
if m.xx > 0
=fclose(m.xx)
erase (m.yy)
return .t.
endif
if file("STOPERR.BIN")
if !"WINDOW"$upper(version())
release STOPERR
endif
endif
return .f.
--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04.1) Linux 2.6.26.8
^ ^ 14:48:01 up 25 days 3:02 3 users load average: 1.04 1.04 1.01
???! ???! ???! ???! ???! ???! ????? (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
Paul Pedersen
2008-12-07 23:03:11 UTC
Permalink
What's a floppy disk?
Post by HerbertDB
Hi,
How can I check if there is a Floppy Disk
inside a Floppy Drive without generating
a "No Disk" error from VFP?
Thanks,
herbert
HerbertDB
2008-12-08 02:04:03 UTC
Permalink
LOL

We still use them here in the Philippines, Gov't Offices
uses them. And Flash Drives are more cheaper than a
1 box of Floppy Disk. I cant move away from Floppy
Drives becoz we use them in Gov't remittances.
Post by Paul Pedersen
What's a floppy disk?
Post by HerbertDB
Hi,
How can I check if there is a Floppy Disk
inside a Floppy Drive without generating
a "No Disk" error from VFP?
Thanks,
herbert
Man-wai Chang ToDie (33.6k)
2008-12-08 09:14:59 UTC
Permalink
Post by Paul Pedersen
What's a floppy disk?
Vi$ta's installation program (WINPE) could read drivers off a USB drive
or a NTFS partition. The need for floppy diskette disk would be gone
soon....
--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04.1) Linux 2.6.26.8
^ ^ 17:13:01 up 26 days 5:27 3 users load average: 1.02 1.07 1.02
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
tom knauf
2008-12-09 11:29:49 UTC
Permalink
Hi,

Thats where you put your sata drivers for xp (yes I know Nlite)
and your bank keyfile for HCBI access (no, no usb in company edition)

Tom
(never buy a pc without it)
Post by Paul Pedersen
What's a floppy disk?
Post by HerbertDB
Hi,
How can I check if there is a Floppy Disk
inside a Floppy Drive without generating
a "No Disk" error from VFP?
Thanks,
herbert
Continue reading on narkive:
Loading...