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")
 

Jeremy1026

macrumors 68020
Nov 3, 2007
2,215
1,029
Judging by the code you posted...actually, its impossible to know what's wrong from what you had.
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
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.
 

mccannmarc

macrumors 6502
Aug 15, 2008
270
0
Manchester, UK
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
 

kalimba

macrumors regular
Jun 10, 2008
102
0
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.