🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.simula
Article #530

Re: Simula's GetInt function

#530
From: Peter Barneveld
Date: Fri, 29 Jul 1994 13:30
54 lines
1716 bytes
>I am trying to use the GetInt function in Simula, but seem to have some
>problems understanding its correct use. When running below program:
>
>begin
> text line;
> line :- Copy("1 2 3 4");
> OutInt(line.GetInt,4);
> OutImage;
> OutInt(line.GetInt,4);
> OutImage;
> OutInt(line.GetInt,4);
> OutImage;
> OutInt(line.GetInt,4);
> OutImage;
>end;
>
>I would expect to get
>
>   1
>   2
>   3
>   4
>
>as output, but get
>
>   1
>   1
>   1
>   1
>
>instead!
>
>Any ideas where I go wrong?
>
>Thanks,
>Albert

GetInt always starts at pos 1 in the text. So you have to use Sub to make a
sub text of "line" or use InInt instead of Getint like:

begin ! Quick and Dirty;
 text line;
 Sysin.Image :- Copy("1 2 3 4");
 OutInt(InInt,4);
 OutImage;
 OutInt(InInt,4);
 OutImage;
 OutInt(InInt,4);
 OutImage;
 OutInt(InInt,4);
 OutImage;
end;

peter
Technical Details
Message-ID: <9407291330.AA29501@metten.fenk.wau.nl>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!news.onramp.net!convex!news.duke.edu!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!news.cac.psu.edu!psuvm!auvm!FENK.WAU.NL!peter

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113dd9,22a819fc6f7d493e
X-Google-Attributes: gid113dd9,public
X-Google-ArrivalTime: 1994-07-29 12:40:42 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!news.onramp.net!convex!news.duke.edu!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!news.cac.psu.edu!psuvm!auvm!FENK.WAU.NL!peter
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.simula
X-Sender: peter@POPServer
X-Envelope-to: SIMULA@nic.SURFnet.nl
MIME-version: 1.0
Content-type: text/plain; charset="us-ascii"
Content-transfer-encoding: 7BIT
Message-ID: <9407291330.AA29501@metten.fenk.wau.nl>
Date: Fri, 29 Jul 1994 15:30:14 +0200
Sender: The SIMULA Language List <SIMULA@UGA.BITNET>
From: Peter Barneveld <peter@FENK.WAU.NL>
Subject: Re: Simula's GetInt function
Lines: 53