From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,723d750f4b80c21e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-16 09:05:24 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!out.nntp.be!propagator-SanJose!in.nntp.be!nntpserver.com!hub1.nntpserver.com!64.214.31.68.MISMATCH!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!nntp-cust.primenet.com!news.streamgate.de!gerhard.nospam From: gerhard.nospam@bigfoot.de (Gerhard =?iso-8859-1?Q?H=E4ring?=) Newsgroups: comp.lang.ada Subject: Re: a little help Date: Tue, 16 Oct 2001 17:47:18 +0200 Organization: Streamgate AG Message-ID: References: <9qgrgh$1f10$1@newsreader1.mclink.it> <9qh8lt$1he7$1@newsreader1.mclink.it> Reply-To: gerhard@bigfoot.de NNTP-Posting-Host: 213-196-68-75.hosts.streamgate.de X-Trace: news.streamgate.de 1003247024 29048 213.196.68.75 (16 Oct 2001 15:43:44 GMT) X-Complaints-To: news@streamgateag.de NNTP-Posting-Date: Tue, 16 Oct 2001 15:43:44 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:14704 Date: 2001-10-16T17:47:18+02:00 List-Id: On Tue, 16 Oct 2001 14:23:58 +0200, F wrote: >in-side variable and the parameter j is in out) and there are still the same >problems. >The problem is the second recall of my procedure. >Please help me................. :-) > > >P.S. >I send you the entire new program > >procedure prova is > type st is new string; > b:st(1..20); > ind:integer:=1; > > procedure leggis (j: in out st; i: in out integer) is > c:character; > begin > while not end_of_line loop > get(c); j(ind):=c; i:=i+1; > end loop; > end leggis; > >begin > new_line; > leggis(b,ind); > for i in 1..ind loop > put(b(i)); > end loop; > ind:=1; > new_line; > -- this is the beginning of my problems!! > leggis(b,ind); > for i in 1..15 loop > put(b(i)); > end loop; >end prova; You're still using global variables. Don't. These are almost always causes of errors. If you need variables in your main procedure, declare them in a declare block like declare ind := integer := 1; begin -- main procedure logic here end prova; I don't want to entirely debug your program (it could be written much simpler with using the appropriate stuff from Ada.Text_IO and perhaps Ada.Strings.(Un)bounded). But now the global variables are causing the bugs. You should avoid them whenever you can. Gerhard -- mail: gerhard bigfoot de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB43C0 public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))