home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 8,890 of 10,840   
   kchengso to Jeffrey R. Bailey   
   Re: Any ways to force the Program to hal   
   19 Oct 04 20:18:23   
   
   XPost: comp.lang.basic.visual.misc   
   From: kchengso@hotmail.com   
      
   Actually, the 3 lines   
      
        Line Input #f1, strJustStr1   
        Input #f1, intTime, intDay   
        Line Input #f1, strJustStr2   
      
   are supposed to function as check and cause the function to halt e.g. if   
   strJustStr1 or strJustStr2 are not string or if intTime or intDay are not   
   integer. However, I have put in the On Error Goto statement, which now   
   prevents the intended check. No matter what value I give to these numbers,   
   the function just ignores them and jump to the NotWritten statement.   
      
   I am now wondering if there are any integers which I can supply to   
   intTime/intDay to cause the function to halt when it executes these   
   statement.   
      
   Any help?   
      
   "Jeffrey R. Bailey"  wrote in message   
   news:B5Vcd.18575$vZ5.4412@tornado.tampabay.rr.com...   
   > Assuming I understand what you are trying to do, if you put the statement:   
   > On Error Goto 0   
   > After the  "Close" statement it will turn off error handling and allow the   
   > code to break on any line producing an error during development.   
   Depending   
   > of course on the options you have set for error handling.   
   >   
   >   
   > --   
   > Jeffrey R. Bailey   
   > "kochs"  wrote in message   
   > news:417092db$1@news.starhub.net.sg...   
   > > Hi, I have a problem here.   
   > >   
   > > Referring to the following programming structure, is there a way to   
   cause   
   > > the computer to overflow or stop  by inputting wrong values of intTime   
   > > and/or intDay? i.e. I don't want the program to jump to label   
   NotWritten:.   
   > > but  want the program to stop working when the input values are of wrong   
   > > types.   
   > >   
   > > Thanks a Million   
   > >   
   > >   
   > > ##   
   > > On Error GoTo NotWritten:   
   > > Open "c:\aaa.txt" For Input As #f1   
   > >     Line Input #f1, strJustStr1   
   > >     Input #f1, intTime, intDay   
   > >     Line Input #f1, strJustStr2   
   > > Close   
   > > If (intTime Mod 75) <> 0 Or (intDay Mod 79) <> 0 Then   
   > > .....   
   > > End If   
   > > ......   
   > > ......   
   > >   
   > > NotWritten:   
   > > ... (other statements follow)   
   > >   
   > > ##   
   > >   
   > >   
   > >   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca