Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRY-CATCH Error handling with Floppy Disk
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01284220
Message ID:
01284277
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
Tommy,

Take a look at How to check if drive is ready FAQ #15764

>
>Lucky me! I have to fix an error in some code that writes a text file to a floppy disk (if the user chose the floppy disk for data transmission instead of the Internet!).
>
>When the user forgets to put a floppy in the drive, or the floppy does not have sufficient space for some reason(!), I should try to trap the error and give the user a simple Messagebox with the error explained to them, and a graceful way out.
>
>You usually get 2 error messages (they are the same), then you exit out of the code....
>
>Here are the error messages...
>
>You get a system form with this as the title...
>"Windows - No Disk"
>
>"Exception Processing Message c0000013 paramaters 75b6bf9c blah blah.... "
>Cancel Try Again Continue...
>
>I press Continue....
>
>same thing pops up on the screen....
>
>Press Continue again...
>
>Then the form I am in exits back to the calling program.
>
>Here is the code for how I wanted to trap the error(s) and make them go AWAY.
>
>
>* If drive A is selected, copy to a and delete from c
>IF lcDrive == "A"
>	lcSource = "c:\" + ALLTRIM(ThisForm.txtReportName.value)
>	lcDest = "a:\" + ALLTRIM(ThisForm.txtReportName.value)
>	ThisForm.txtStatus.value = "Copying to drive A:..."
>*TMT 01/22/2008 Code to fix problem of error message coming up when a problem with the *floppy disk (no disk, no room, bad copy, etc....)	
>	TRY
>       	   COPY FILE (lcSource) TO (lcDest)
>	CATCH TO oErr
>           MESSAGEBOX("Catch: - " + ALLTRIM(STR(oErr.ErrorNo)))
>	FINALLY
>	ENDTRY
>*TMT
>
>
>How do I stop the two error messages and just have the "Catch: - 1102" show up instead.
>As it is, I get 3 error messages.... the 2 before and the Catch statement.... sigh.
>
>Thanks!
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform