PDA

View Full Version : Pascal Labels


Johan Gielen
03-23-2002, 01:34 PM
Ok, I'm quite new with Pascal. I had some basic Pascal lessons in school, but I want to learn more about it. One thing I don't get the hang of is the use of labels. I just don't know how I should insert them into my progs. and how to use the GOTO command with them.

aym
03-24-2002, 11:46 AM
program labeltest;
label 100;
var
i , n : integer;
x : real;
begin
readln(n);
for i := 1 to n do
begin
readln(x);
if ( x < 0) then
goto 100;
writeln( sqr(x) );
end;
100:
end.


This is an example, if you don't understand it, post and I'll explain.