TIB: How does goto work?


[Prev][Next][Index][Thread]

TIB: How does goto work?




Some people have been saying that whenever goto is called, it starts at the 
top and goes down until it finds the lbl.  Somehow, this doesn't seem 
possible.  You can write a huge program with a lbl at the very end with all 
the traditional exit stuff (ClrGraph, SetFold(Main), etc), but if it jumps 
there from the very beginning, it does so very quickly.  Much too quickly to 
be checking one line at a time.  The way I always thought (and hoped) that it 
worked was that the compiler replaced all the goto's with
jumps to addresses.  This way, only the compiler needs to check through the 
code line by line.  That would be much faster and certainly seems more 
logical.  Does anyone know for certain?

                                    Grant Elliott
                                    <A HREF="pa.ticalc.org">Programmers 
Anonymous</A>  


Follow-Ups: