Re: Colon in code?

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




George Nicholson wrote:
> In this case, I suspect "Hide:" is a line label (Colons can also be used to
> separate multi commands on a single line, but that doesn't seem to be the
> case here). There is probably a "GoTo Hide" instruction somewhere in the
> same function/procedure where you found it (if there isn't, there probably
> was one at some point in time and someone simply forgot to take the
> corresponding label out.)
>
> Use of line labels and goto's is (generally) frowned upon (outside of Error
> trapping where they are a necessity). This has become one of those "rules to
> be broken" because improper/overuse of them is an very easy trap for newbie
> coders to fall into since there is (almost) always a better way to achieve
> the same results. Extreme caution is advised or you could quickly end up
> with "spaghetti code" that jumps all over the place: something totally
> unreadable & unmanageable, even if you wrote it yourself yesterday.
>
> "Line labels" doesn't warrant an entry in Help, but you can get to a
> hyperlink definition of them via the entry for the "GoTo" statement.
>
> Let's be careful out there...
>
> HTH,
> --
> George Nicholson
>
> Remove 'Junk' from return address.
>
>
> "davegb" <davegb@xxxxxxxxxxxxxx> wrote in message
> news:1137107867.468758.184340@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > What does a colon in VBA code do? I.e.,
> >
> > Hide:
> >
> > I tried to figure out how to look this up both online and in
> > Walkenbach, but couldn't find anything on it.
> > Thanks.
> >
Thanks for all your replys!

.



Relevant Pages

  • Re: change variables
    ... where goto is the most appropriate control structure in C programs. ... The C switch statement could generate a jump table to its case labels ... point of the flow is contrained to be the end of the switch block. ...
    (comp.lang.cobol)
  • Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?
    ... Fine, but then generalize the labels to be alphanumerics, perhaps terminated by a single colon. ... The main problem with goto targets in Fortran is not the GOTO, ... "GOTO considered harmful" considered harmful. ... In any case, it seems that the Fortran Standards are in the process of making block constructs more uniform, so constructive discussions here may actually have an influence. ...
    (comp.lang.fortran)
  • Re: Assigned gotos in standard C
    ... have a number of labels LABEL_0, LABEL_0, .. ... able to take an int k and do goto LABEL_k. ... Calling functions from a dispatch loop, ...
    (comp.lang.c)
  • Re: How to GOTO
    ... This means that I have need for a Forth GOTO, ... DEFERRED-LABEL is just a CELL with an address to be later ... Predeclaring labels by name is not nice when you have 50 or more labels. ... Hmm, numeric parsing labels might be okay with an extra word RESOLVE-GOTOS, ...
    (comp.lang.forth)