Title: RE: [MI-L] OnError Command
Greg
 
I've cracked it: 
 
- It got past the 1st two Notes (1) and (2) then crashed OK?
- The next line was "If tlAsk".  If you look at the param list it's actually "tAsk" (it had originally been "tcAsk" for a char param and I changed it to logical, but obviously cocked up the formal decl)
- Hence it would normally error out here with something like "tlAsk does not exist"
- But we're IN the error routine so this can't be reported, so it goes fatal on us without a word of what's wrong.
 
So thanks to you and others who suggested that the fault may lie in the error handler itself, I put a handler in the handler and caught the little booger.
 
Thanks to you, Tony and Lars for your help/suggestions/effort/interest, as usual.
 
Apologies for not answering all (now redundant) suggestions personally.
 
BTW I did say "Can you see anything wrong.  Perhaps in the function params declaration?" but a typo was not what I was suspecting at the time :-)
 
Terry


From: Driver, Greg 9434 [mailto:[EMAIL PROTECTED]
Sent: 19 May 2006 15:01
To: Terry McDonnell
Subject: RE: [MI-L] OnError Command

Terry,

Just been testing the code snippet you included in your last email and it all seems fine.  The only thing that I can see is that it's not jumping to the RESUME label after it's finished the ERROR_REPORT function call (the code in the function runs but any code after the RESUME statement isn't executed).  However, if I comment out the ERRROR_REPORT function call and just put a Note Err() statement in, it does jump to the RESUME label and execute the subsequent code!!  Perhaps this is the problem and MapBasic doesn't like jumping out of error handling routine?  I've included the code I was using to test so you can see what I mean.

Cheers

Greg Driver

System Administrator
Applications Support
ICT
NOT PROTECTIVELY MARKED


-----Original Message-----
From: Terry McDonnell [mailto:[EMAIL PROTECTED]]
Sent: 19 May 2006 12:25
To: Driver, Greg 9434
Subject: RE: [MI-L] OnError Command


Hi Greg
 
Perhaps I should mention that the prog hasn't experienced any erros. Rather I simulated one by pasting Error <errno> in the code, in order to fire the error routine.

Maybe the error is indeed in the error routine.
 
I put trace notes in the code (see below) to see what goes on in the error routine. It passes the first note - commented with (1), then (2), then when the note is released I don't know what happens as this is where it bombs out.

Can you see anything wrong.  Perhaps in the function params declaration?

'ppreciate the help and interest, as usual.

Best

Terry
 
========================================================================
====================
Function ERROR_REPORT( ByVal tnErrNo as Integer, ByVal tcErrMess, ByVal tcProcName as String,
                             ByVal tAsk as Logical) as Logical
'____________________
'If supplied with a tcProName (param) include that in the message. 'If tlAsk param is true:  then use ASK() function to ask if continue or not.

'ELse                             then use NOTE proc just to display the
message.
'____________________________
 Dim    lcMessage               as String,
                llContinue      as Logical
note "in ERROR_REPORT"   ' (1)
 llContinue             = TRUE
 lcMessage              = "Error No: " + RTrim$( Str$( tnErrNo)) + Chr$(
13) + RTrim$( tcErrMess)
 If tcProcName <> "" then
        lcMessage               = lcMessage + Chr$( 13) + ", in
procedure " + RTrim$( tcProcName) + "."
 End If
 lcMessage              = lcMessage + Chr$( 13) + "Please note down
error message."
note "lcmessage = " + lcMessage  '(2)

 If tlAsk then
note "ASK"
         llContinue     = ASK( lcMessage + Chr$(13) + "Do you wish to
Continue or Quit mPlan Maps?", "Continue", "Quit")
 Else
note "Don't ASK"
         Note lcMessage
 End If
note "llcontinue = " + llcontinue

 ERROR_REPORT           = llContinue
End Function

----------------------------------------------------
From: Driver, Greg 9434 [mailto:[EMAIL PROTECTED]]
Sent: 19 May 2006 09:31
To: Terry McDonnell
Subject: RE: [MI-L] OnError Command



Hi Terry,

I can't see any problems with the code you've included and so may be the problem is within the ERROR_REPORT code?  If there is a problem in the code then this will explain why it's bombing out otherwise you code should handle the error and then resume at the ERR_RESUME label.

Cheers

Greg Driver


Internet communications are not secure and therefore Surrey Police does not accept legal responsibility for the contents of this message.  This email and any attachments may be confidential. They may contain privileged information and are intended for the named addressee (s) only. They must not be distributed without our consent. If you are not the intended recipient, please notify us immediately and delete the message and any attachments from your computer, do not disclose, distribute, or retain this email or any part of it. Unless expressly stated, opinions in this email are those of the individual sender, and not of Surrey Police. We believe but do not warrant that this e-mail and any attachments are virus free. You must therefore take full responsibility for virus checking. Surrey Police reserves the right to monitor all email communications through their networks.


_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to