Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Error and Local Error

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
Eric Coleman Posted - Jan 25 2005 : 10:33:21 PM
I have the habit of using "On Local Error" for ignoring specific errors in certain subs and functions. However, it doesn't work. Well, it works like I expect it to, but the statement "On Error" doesn't.

Anyways, I tried looking up what the "Local" paramter means, but I can't find any mention of it in the VB help files. I looked at the VB keyword list and it's not listed.

I then thought that perhaps it's a relic from old VB, but I don't have any 16 Bit VB versions installed. I do have QBasic 1.0 and I checked, but no such luck in finding the history of "local."

So, my question, where does it come from and what does it do?

Download Attachment: vbgamer_error_test.zip
1.83 KB
3   L A T E S T    R E P L I E S    (Newest First)
Almar Posted - Jan 27 2005 : 07:04:07 AM
I've used it in YALG. There is a difference somehow. Sometimes I feel like Errors are going through the call stack. I can't explain, unfrotunatly, but sometimes the errors ended up somewhere else than were they really were :)
Eric Coleman Posted - Jan 26 2005 : 08:05:05 AM
If it's from earlier versions then I probably learned it from using VB 3. It's definitely not in QBasic or QuickBasic. And just for the record, I actually searched google and couldn't find anything. Thanks VBBR.
VBBR Posted - Jan 26 2005 : 06:33:26 AM
There's something here but it needs some subscription...
http://accessvbsql.advisor.com/doc/10945

Search query I used (google):
http://www.google.com.br/search?q=%28%22visual+basic%22+OR+vb%29+%22local+error%22+%22on+error%22

Now that's something interesting... from http://en.wikibooks.org/wiki/Programming:Visual_Basic#Error_Checking:
Private Sub Form_Load()  
             On Error GoTo Label1  
             i = 1 / 0  
             '...  
             'Some code  
             Exit Sub
      Label1:  
             'Handles the error  
             MsgBox "Error Number " & Err.Number & ":" & Err.Description  
      End Sub

The above example is the safest way of detecting and handling any error that takes place in the subroutine. However you can also choose to ignore errors by using "On Error Resume Next" and watch for errors in a certain line of code by using "On Local Error ..."

Hey wait, I found another one From http://www.mrexcel.com/archive2/44000/51072.htm:
"Apparently there is no difference. The Local keyword is a holdover from earlier versions to make it easier to upgrade code. It is ignored in VB."

VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.