|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error 6 line of code?I came across the following line of code which errors out. If lrc <> ERROR_NONE Then Error 5 You can see examples of this code in MS KB articles. For example http://support.microsoft.com/kb/210860 This compiles but at execution time causes an error. Now this isn't a big deal as the code is going to drop out of the routine anyhow. But I'm curious. What is the Error 5 supposed to be doing? Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/
Show quote
Hide quote
"Tony Toews [MVP]" <tto***@telusplanet.net> wrote in message It simulates an error, as if it happened. See "Error statement" in MSDN, and news:rnfbv59609li420afseegar284ive2i15l@4ax.com... > Folks > > I came across the following line of code which errors out. > > If lrc <> ERROR_NONE Then Error 5 > > You can see examples of this code in MS KB articles. For example > http://support.microsoft.com/kb/210860 > > This compiles but at execution time causes an error. Now this isn't a > big deal as the code is going to drop out of the routine anyhow. > > But I'm curious. What is the Error 5 supposed to be doing? also Err.Raise, which does the same thing. Confused yet? Try this fun code: Option Explicit Private Sub Form_Load() Dim i As Long On Error Resume Next For i = 1 To 20 Err.Raise i Debug.Print "Error " & Err.Number & ": " & Err.Description Err.Clear Next End Sub Tony Toews [MVP] wrote:
> Folks Signals the calling routine it passed an invalid argument. :-)> > I came across the following line of code which errors out. > > If lrc <> ERROR_NONE Then Error 5 > > You can see examples of this code in MS KB articles. For example > http://support.microsoft.com/kb/210860 > > This compiles but at execution time causes an error. Now this isn't a > big deal as the code is going to drop out of the routine anyhow. > > But I'm curious. What is the Error 5 supposed to be doing? -- ..NET: It's About Trust! http://vfred.mvps.org Customer Hatred Knows No Bounds at MSFT ClassicVB Users Regroup! comp.lang.basic.visual.misc Free usenet access at http://www.eternal-september.org "Tony Toews [MVP]" <tto***@telusplanet.net> wrote Its supposed to cause an error.> I came across the following line of code which errors out. > > If lrc <> ERROR_NONE Then Error 5 <...> > But I'm curious. What is the Error 5 supposed to be doing? LFS Larry Serflaten wrote:
> LFS Your clock is hosed. Shouldn't you be -0500?-- ..NET: It's About Trust! http://vfred.mvps.org Customer Hatred Knows No Bounds at MSFT ClassicVB Users Regroup! comp.lang.basic.visual.misc Free usenet access at http://www.eternal-september.org "Karl E. Peterson" <k***@exmvps.org> wrote Its just after 7:30 (CST is -6:00) as I post this. I'll see what the> Your clock is hosed. Shouldn't you be -0500? servers say when it shows up.... LFS Larry Serflaten wrote:
> "Karl E. Peterson" <k***@exmvps.org> wrote Yep! Date: Thu, 20 May 2010 19:32:07 -0600>> Your clock is hosed. Shouldn't you be -0500? > > Its just after 7:30 (CST is -6:00) as I post this. I'll see what the > servers say when it shows up.... But you're in CDT, which is -0500, not CST, right? ;-) That means, my posts that answer yours appear to have been made before the ones they're replying to. I'm in PDT now, which is -0700. -- ..NET: It's About Trust! http://vfred.mvps.org Customer Hatred Knows No Bounds at MSFT ClassicVB Users Regroup! comp.lang.basic.visual.misc Free usenet access at http://www.eternal-september.org "Karl E. Peterson" <k***@exmvps.org> wrote That stupid checkbox wasn't checked!> Yep! Date: Thu, 20 May 2010 19:32:07 -0600 > > But you're in CDT, which is -0500, not CST, right? ;-) <g> LFS Larry Serflaten wrote:
> "Karl E. Peterson" <k***@exmvps.org> wrote I ask you, people... Could a web forum *ever* be this fun?> >> Yep! Date: Thu, 20 May 2010 19:32:07 -0600 >> >> But you're in CDT, which is -0500, not CST, right? ;-) > > That stupid checkbox wasn't checked! > > <g> > LFS -- ..NET: It's About Trust! http://vfred.mvps.org Customer Hatred Knows No Bounds at MSFT ClassicVB Users Regroup! comp.lang.basic.visual.misc Free usenet access at http://www.eternal-september.org On 21/05/2010 00:03, Tony Toews [MVP] wrote:
> Folks Well I never, been using the language for 15+ years and I never noticed > > I came across the following line of code which errors out. > > If lrc<> ERROR_NONE Then Error 5 > > You can see examples of this code in MS KB articles. For example > http://support.microsoft.com/kb/210860 > > This compiles but at execution time causes an error. Now this isn't a > big deal as the code is going to drop out of the routine anyhow. > > But I'm curious. What is the Error 5 supposed to be doing? that keyword... -- Dee Earley (dee.ear***@icode.co.uk) i-Catcher Development Team iCode Systems (Replies direct to my email address will be ignored. Please reply to the group.) "Dee Earley" <dee.ear***@icode.co.uk> wrote in message It was available in pre-visual versions of BASIC as well. If not that exact news:%23Zd1WTM%23KHA.208@TK2MSFTNGP02.phx.gbl... > Well I never, been using the language for 15+ years and I never noticed > that keyword... keyword, at least the functionality. I know I could explicitly raise an error in TRS-80 Color BASIC. On 21/05/2010 16:20, Jeff Johnson wrote:
> "Dee Earley"<dee.ear***@icode.co.uk> wrote in message Yeah, I was on QBasic before that and that predated my knowledge of > news:%23Zd1WTM%23KHA.208@TK2MSFTNGP02.phx.gbl... > >> Well I never, been using the language for 15+ years and I never noticed >> that keyword... > > It was available in pre-visual versions of BASIC as well. If not that exact > keyword, at least the functionality. I know I could explicitly raise an > error in TRS-80 Color BASIC. proper error handling or structured coding :) -- Dee Earley (dee.ear***@icode.co.uk) i-Catcher Development Team iCode Systems (Replies direct to my email address will be ignored. Please reply to the group.) Dee Earley <dee.ear***@icode.co.uk> wrote:
>> If lrc<> ERROR_NONE Then Error 5 Glad to read I'm not the only one. <smile>> >Well I never, been using the language for 15+ years and I never noticed >that keyword... I replaced the Error 5 line with a Goto Exit routine. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/
Reminder - Microsoft Responds to the Evolution of Community
Error 6 Overflow Questions about adding barcode scanning capability Where Does the PDW Get the DLLs & OCXs It Put in the Distribution Package? VB6 syntax question Directory Comments Object Reqired Error Using Kill RE: VB & Common Dialog??? How to 'read' an operating program for info Problem installing COM+ application proxy on widows 7 |
|||||||||||||||||||||||