Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 03-23-2002, 12:34 PM   #1
Member (7 bit)
 
Join Date: Mar 2002
Location: The Netherlands
Posts: 91
Send a message via ICQ to Johan Gielen
Question Pascal Labels

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.
Johan Gielen is offline   Reply With Quote
Old 03-24-2002, 10:46 AM   #2
aym
Registered User
 
aym's Avatar
 
Join Date: Nov 2001
Posts: 1,965
Code:
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.

Last edited by aym; 03-24-2002 at 12:10 PM.
aym is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:53 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2