Log in

View Full Version : pascal goto command



cadaver
03-01-2006, 07:53 PM
how can i use goto in pascal program to go to a specific line

for ex.
we have 3 lined program. in line 3 i want to go to line 2

please give me detailed instruction
thnxs

Twey
03-01-2006, 08:22 PM
From what little PASCAL I remember, I don't think this is possible. Is there a reason you can't use labels?

cadaver
03-01-2006, 11:27 PM
can you show me an example of label-goto usage. please.

Twey
03-02-2006, 03:54 PM
(* Some code *)
LABELONE:
(* more code *)
GOTO LABELONE;
Actually, from googling around, Turbo Pascal seems to support using line numbers in a GOTO statement (E.G. GOTO 3;). However, this isn't a universal extension.