Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does Message(1) return bogus info in my error handler???
Message
De
22/07/1999 21:56:05
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Why does Message(1) return bogus info in my error handler???
Divers
Thread ID:
00245133
Message ID:
00245133
Vues:
53
Hi,

I've noticed that for some reason the function message(1) in VFP 5 (I haven't tried it in VFP6) returns a bogus command line about 80% of the time. This is in an app where I have included the Debug info in the project.

I can recreate the error very easily. Lets say in the beginning of the program I have the following:

on error do errorhand with error(),message(),program(),lineno(),message(1)

Then in the middle of the program I type this:

lcBogusCommand="dsklfd;ajk;klja"
&lcBogusCommand

This will obviously return an error but instead of Message(1) returning the actual command line that caused the error, my messagebox appears with the following:

Error 16:Unrecogized command verb.
Line 42 of orphanrec
BETWEEN(lsterm_mo,0,11)

The last line is completely bogus, I think lsterm_mo is a variable in a different .prg file, not even in this project, but possibly in the same directory. Does anyone know why this happens? The actual error handler I use is below, very simple for a very simple program.


FUNCTION ErrorHand
LPARAMETER ernum,ercode,erprog,erline,ermsg
m.msgstr="Error "+alltrim(str(ernum))+": "+ercode+CHR(13)+ ;
"Line "+str(erline,5)+" of "+erprog+CHR(13)+ermsg
m.er=messagebox(m.msgstr,2+48+0,"Program Error")
cancel
return
ENDFUNC &&* ErrorHandler
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform