|
-
Aug 22nd, 2002, 08:42 AM
#1
Thread Starter
New Member
Local error
Is there a difference between the following two lines:
On Error Goto ErrorHandler
and
On Local Error Goto ErrorHandler
I can't find any documentation on it, but I assume there is some reason for the inclusion of the Local keyword in the examples I've seen.
-
Aug 22nd, 2002, 08:46 AM
#2
On Error Statement Syntax
On Error GoTo line
On Error Resume Next
On Error GoTo 0
That ones straight out of the MSDN helpfiles, I guess the local bit could be left over as a compatibility issue if earlier versions of vb supported it, but it looks like your better off doing without it now.
-
Aug 22nd, 2002, 08:53 AM
#3
Thread Starter
New Member
I'm not looking for a better way of doing things, just wondering if there was any distinction made between the syntax. eg. the error handler does not come into effect in case of a DLL error.
It would be useful..!
-
Aug 22nd, 2002, 08:55 AM
#4
Alex is completely correct. On Local Error Blah Blah was used in older, DOS based version of the Basic programming language. I didn't even know it was still supported.
Ignore it. Don't use it. One day it won't be supported anymore (I would be surprized if .NET supports it)
-
Aug 22nd, 2002, 08:56 AM
#5
Cool that makes a nice change!
-
Aug 22nd, 2002, 09:15 AM
#6
the error object has err.lastdllerror... maybe that can help you if you are looking to determine if errors are from a dll you are using.. here is what MSDN has to say
The LastDLLError property applies only to DLL calls made from Visual Basic code. When such a call is made, the called function usually returns a code indicating success or failure, and the LastDLLError property is filled. Check the documentation for the DLL's functions to determine the return values that indicate success or failure. Whenever the failure code is returned, the Visual Basic application should immediately check the LastDLLError property. No exception is raised when the LastDLLError property is set.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|