Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iphonejudy

macrumors 6502
Original poster
Sep 12, 2008
301
1
I used goto statement as below


News:

-------;
-------;

Go to News;

But i got errors("News label used but not defined")
 
Judging by the code you posted...actually, its impossible to know what's wrong from what you had.
 
As far as I know, the appropriate syntax for a goto statement is "goto News;" not "Go to News;". Do you reallllly want to use a goto statement though? Chances are there is a much less archaic way to do whatever you are trying to do.
 
Why on earth are you using goto in such a simple piece of code? Using goto is considered bad programming practice in C/C++/Objective-C (in fact most languages besides archaic languages and assembler) these days and can easily be avoided with the use of functions
 
As far as I know, the appropriate syntax for a goto statement is "goto News;" not "Go to News;". Do you reallllly want to use a goto statement though? Chances are there is a much less archaic way to do whatever you are trying to do.

Why on earth are you using goto in such a simple piece of code? Using goto is considered bad programming practice in C/C++/Objective-C (in fact most languages besides archaic languages and assembler) these days and can easily be avoided with the use of functions
I think the error is the compiler's way of saying "Please, for goodness' sake, do not use the goto statement!" :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.