Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error handling problem - Help!
Message
De
11/06/2002 18:48:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Divers
Thread ID:
00667122
Message ID:
00667134
Vues:
20
Michael,

Where is this code? Is it in a form method or within a method of an object on a form?

Are you trying to solve this for someone else who has Codemine?

I am running Codemine, and I'm willing to help out...

>I've put together a Visual Class using the MSCOMM object. One of the methods scans the ports for live serial ports to look for an attached device.
>
>The way the scan works is that it communicates with each port in turn. If it gets an error, the port's assumed not to exist. This works fine in vanilla VFP - I substitute the ONERROR routine just before the test and then restore it afterwards:
>
>
mbhError = ""
>
>cOldErrorHandler = ON('ERROR')
>
>IF TYPE('THIS.nCommPort') <> 'N'
>	THIS.nCommPort=VAL(THIS.nCommPort)
>ENDIF
>IF BETWEEN(THIS.nCommPort,1,16)
>	ON ERROR mbhError = "Error "+TRANSFORM(ERROR()) + ": "+ SYS(2018)
>	THIS.CommPort=THIS.nCommPort
>	THIS.PortOpen=.T.
>	ON ERROR &cOldErrorHandler
>....
>Well, CodeMine's error handler seems to be smarter than me - it seems to catch the error and report it instead of allowing my error handler to just grab the description of the error and act accordingly.
>
>So... I tried putting the error handling code into the ERROR procedure of the class. Once again, it works in vanilla VFP, but not within the CodeMine framework.
>
>Since I don't own CodeMine, it's hard to test and diagnose the cure for this malady. Can someone tell me how to bypass the CodeMine error handler for my comm check? Should I put it in the screen's ERROR procedure with a dodefault if it's not the error I'm trapping, or what?
>
>TIA
>Michael
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform