Re: Help with wierd/unexplainable error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



that is because 6 is after two 'end function' lines, so it never gets there.
change the 'end function' to 'exit function' if you want to exit without
ending

"Devin Linnington" <DevinLinnington@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:31B0B487-139B-4FBF-80EF-69961D7D8F6D@xxxxxxxxxxxxxxxx
> Hi, I'm doing a simple program that worked fine but when i started to
> debug
> it with sample data, I stumbled upon an error that I can't possibly
> explain.
> It apears that while to compile this paticular function, when it reaches
> the
> 'GoTo 6' (as in goto label 6) it thinks there is no label 6 in the
> function
> (It gives me the error 'label not defined') . This is obviously not the
> case,
> just look at the code below!
>
>
> 2:
> If xarg <= x(1) Then GoTo 4
> If xarg >= x(n) Then GoTo 5
> GoTo 6 <== where
> it reaches error
> 3:
> If xarg >= x(1) Then GoTo 4
> If xarg <= x(n) Then GoTo 5
> GoTo 6
> 4:
> flagr = y(1)
> End Function
> 5:
> flagr = y(n)
> End Function
>
> ' Determine value of max1
> 6: <== supposed
> to go here....
> Select Case l
> Case 1
> GoTo 10
> Case 2
> GoTo 20
> End Select
>
>
> Ignoring the comments and variables, it's pretty easy to see that there is
> indeed a label 6 right there! I have other labels that it has to go
> through
> earlier in the code, and they are writen in the same fashion as the '6:'
> one.
> I have totally run out of options of what I can do here, as even changing
> the
> '6' to something else doesn't fix the problem. Also, it is a compiler
> error
> so that the function doesn't even run. What really gets me is that all I
> did
> was change the variables being entered into the function, so somehow that
> affected the compiler and now it doesn't like that label (note that it did
> work for other values). I'm really stuck now, I just don't know what is
> going
> on!


.



Relevant Pages

  • Re: what dialect of fortran is this ?
    ... >Ok to help you all out the original compiler was some version of LAHEY ... >do loop etc ... all the labels in the assigned goto being present. ... the jump to the label given in the call is made. ...
    (comp.lang.fortran)
  • Help with wierd/unexplainable error
    ... (It gives me the error 'label not defined') ... If xarg <= xThen GoTo 5 ... flagr = y ... it is a compiler error ...
    (microsoft.public.office.developer.vba)
  • Re: E. W. Dijkstra VS. John McCarthy. A rebuttal to Paul Grahams web writings.
    ... > aggravated form of that: assign a label to a variable and goto that ... > label from any point in the program. ... > on the scope of the goto. ... The old K&R C compiler would let you do this (well, ...
    (comp.lang.lisp)
  • Re: what dialect of fortran is this ?
    ... Ok to help you all out the original compiler was some version of LAHEY ... The reason I'm asking about which label to goto in the line of code ... I had assumed that jumping to 103 would fall thru the bottom of the loop but ...
    (comp.lang.fortran)
  • Re: UART RS232 "hello world" really taking shape now.
    ... executed at ELABORATION time - the COMPILER takes ... the hardware just sees a lookup table. ... you could stick with the nice simple "goto address" ... MSG "At B" ...
    (comp.arch.fpga)