{NeoBook Objects} ObjectType=3 X1=208 Y1=144 X2=296 Y2=176 LineColor=46186688 LineWidth=1 LineStyle=0 LineOrigin=0 FillColor=12632256 FillPattern=0 FillMode=0 Font=Arial FontSize=10 FontStyle=0 TextColor=0 Text=Drive: [drive] Align=2 Key=0 OverlayText=No TransImages=No WordWrap=No Style=0 UpImage= DownImage= OverImage= VarName= MaxLen=255 InitState=0 Action=.build a string with all the drive letters D through Z |SetVar "[string]" "defghijklmnopqrstuvwxyz" ||.determine the length of the drive string |StrLen "[string]" "[string_len]" ||SetVar "[x]" "1" |.loop until x = the length of the drive string |While "[x]" "<=" "[string_len]" ||.pick out one drive letter at a time |SubStr "[string]" "[x]" "1" "[drive]" ||.check for the file at this drive letter |FileExists "[drive]:\MyFile.EXT" "[FileEx]" ||If "[FileEx]" "=" "TRUE" |.here we've found the file so store the |.drive letter in the var [cd] |SetVar "[cd]" "[drive]:\" ||AlertBox "File was Found" "OK to continue with program" |GotoLine "TheEND" |Else |Math "[x]+1" "" "[x]" |EndIf ||EndWhile | |."let's give the user a chance to make sure the CD |.drive isn't just really really slow and the script |.executed too fast or some such nonesense" ||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" |gotoline "1" |EndIF ||If "[TryAgain]" "=" "2" |."If the user cancels, you could put an exit command |.so that your program cannot be run without the |.correct CD. Or you could give them a note that says|.the program will not open all files until the correct CD|.is located...just some ideas. Have fun." ||Exit "" ""|EndIf | ||:TheEND