Mark - 

Error handling is within a sub/function, not 'somewhere in the program' - if
you want a central handling point you can define a sub which all the error
handlers call but you need to trap the errors at the procedure level. Your
label clause probably needs splitting over two lines though others may know
better than I. So - 

At the top of your program

Declare Sub Errortrapper(byval sMsg as string)

Sub Errortrapper(byval sMsg as string)
Print sMsg
End Sub

Then your routines would look like

Sub DoStuff
OnError Goto lblError

Blah 

Exit sub
lblError:
Call ErrorTrapper(Err$())
End Sub

This also allows you to optionally conditionally handle error conditions in
the lines that follow lblError:

HTH

> Paul Crisp
> Syntegra
> 
> Direct:  0191 461 4522 
> Mobile: 0776 414 3762
> Fax: (0191) 461 1959
> 
> Innovation Place Metro Riverside Park
> Delta Bank Road Gateshead Tyne & Wear NE11 9DJ
> 


-----Original Message-----
From: Mark Williamson [mailto:[EMAIL PROTECTED]]
Sent: 16 May 2002 13:35
To: [EMAIL PROTECTED]
Subject: MI-L OnError GoTo


Hi

I'm trying to set up an OnError statement for a 
Server_Execute call to a remote DB. 

OnError GoTo addPOIError
... call to db



outside Sub/Function

addPOIError: Note "Error adding POI"


However I am getting an unresolved label error when 
compiling. Any ideas

Thanks

Mark
--
Mark Williamson
Heriot-Watt University
[EMAIL PROTECTED]


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


********************************************************************

This email may contain information which is privileged or confidential. If you are not 
the intended recipient of this email, please notify the sender immediately and delete 
it without reading, copying, storing, forwarding or disclosing its contents to any 
other person
Thank you

Check us out at http://www.syntegra.com

********************************************************************

Reply via email to