![]() ![]()
|
Home PUBz Grafx Pax Tips & Trix Neo-Linx Neo-Talk Neo-Filez Search NeoDezign
|
![]() |
John
Ballard came
up with a great solution for our need to find our CD in whatever CDROM
drive it might be in. I have seen new computers with CD's installed as
high as Q: drive, for some odd reason! And, with DVD's and Writers becoming
more and more affordable some people may have more than one CD ROM drive
in their system. If an end-user has two CD ROM drives the NeoBook [CDRomDrive]
global variable becomes inaffective as it will only return the drive letter
of the first CD ROM drive.
John's script scanned each and every possible drive letter looking for the existence of a specified file. If that file did not exist in the expected location the script would continue to the next subsequent drive letter until the file was found or drive Z: was scanned. While John's script was very thorough, he admits it can also get somewhat lengthy if you want to scan all the way to the Z: drive. I tinkered with John's original concept and came up a another shorter routine for the same problem. Together,
John
and I came up with the script shown below.
.build
a string with all the drive letters D through Z
.determine
the length of the drive string
SetVar
"[x]" "1"
.pick
out one drive letter at a time
.check
for the file at this drive letter
If "[FileEx]"
"=" "TRUE"
AlertBox
"File was Found" "OK to continue with program"
EndWhile ."let's
give the user a chance to make sure the CD
MessageBox "File Not Found" "The Correct CD could not be found. |Perhaps the CD-ROM drive was idle.|What would you like to do?" "Try Again|Cancel" "[TryAgain]" If "[TryAgain]"
"=" "1"
If "[TryAgain]"
"=" "2"
:TheEND
Here is a Copy & Paste friendly version of the script shown above. This file is actually a NeoBook Button Object. It looks like a bunch of gobbley-gook but all you need to do is Copy it to the clipboard then Paste it into your NeoBook project. After you click the link below press Ctrl+A to Select All. Then press Ctrl+C to Copy. Move to your NeoBook project and press Ctrl+V to Paste. Bam! There's your button...
|