Page 1 of 1

Using [CDROMDrive], - detecting cd rom drive

PostPosted: Thu Feb 07, 2002 4:31 pm
by Jim Brammer
Using [CDROMDrive]

Does anybody knows how to detect whether the [PubDir] is located in a Read-Only media (e.g., CDROM drive)?

I used the scripts (pseudocode)...

If "[PubDrive]" "=" "[CDROMDrive]"
set folder path to C SAMPLE
else
set folder path to [PubDir]SAMPLE
EndIf

If there are more than 2 CD-ROM drives, the [CDROMDrive] command does not work for the 2nd drive. As such, if you have a PUB that writes to the same drive where the PUb resides... you will have error becos' NB4 does not detected it as a CD-ROM drive.

However, if you run the PUB from the 1st CD-ROM drive, everything is OK.


According to Dave, the [CDROMDrive] will not work for 2nd drive.. and There is a simple Windows function that programmers use to determine the drive type, but there's no interface for it in NeoBook. "

Maybe.. a plugin would be great. I wanted to kickstart myself to learn Delphi... but right now... I have some NB4 projects in hand... so have to KIV it. Anybody has any suggestion or workaround?

Rgds
Ronnie



--------------------------------------------------------------------------------




Hy Ronnie,

write a little routin to the function library you can call in future. This function only will do a temporary filewrite action. After the action, check the global [LastError] variable for success or not.
You only have to deactivate the DISPLAY ERROR MESSAGES in the Books-properties, section MISC (topmost)

Maybe not the most clever way, but it works 8-)

Gerhard



--------------------------------------------------------------------------------



Hi Gerhard,

Yes, I have thought of doing that before .. although it's not as great as it should be.. it's the current workable solution...

Thanks!
Ronnie