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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Code Snippets

Status
Not open for further replies.

Langley

Programmer
Jan 23, 2002
592
US
I'd like to start a thread comprised of small useful methods or code samples. I think a lot of us take for granted that the newer users know how to code the simpler things.

Here's my first contribution, a simple while loop that checks for a disk in the A: drive.

Code:
var
   userRetry   string
endvar

setmouseShape(MouseWait)

While not isDir("A:\\")

   userRetry = msgRetryCancel("Drive A:","There is no disk in Drive A:\n Insert a blank one and press Retry")
   if UserRetry = "Cancel"
      then  setmouseShape(MouseArrow)
            return ; and additional error processing
   endif

endwhile

; any additional processing, like file copying, goes here

setmouseShape(MouseArrow)

This is basic code, you could set return values or do any number of things, but this should get you started.

Mac
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top