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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,49f7dd1bad1910ff X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-15 19:29:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc02.POSTED!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: <8336eb21.0310131423.7410e1ec@posting.google.com> Subject: Re: Problems with Ada.Text_IO and strings. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <_nnjb.142245$%h1.142565@sccrnsc02> NNTP-Posting-Host: 12.211.13.75 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc02 1066271354 12.211.13.75 (Thu, 16 Oct 2003 02:29:14 GMT) NNTP-Posting-Date: Thu, 16 Oct 2003 02:29:14 GMT Organization: Comcast Online Date: Thu, 16 Oct 2003 02:29:14 GMT Xref: archiver1.google.com comp.lang.ada:938 Date: 2003-10-16T02:29:14+00:00 List-Id: In Ada when you create a string, say: S1 : String(1..10) and pass that string to a procedure, say Get_Line( S1, last ); Where Get_Line has the interface defined as: procedure Get_Line( str : out String; last : out Natural ); You'll notice that the length of the string is not explicity passed as a separate item to the procedure. In Ada the bounds of the array are passed implicitly. The Get_Line procedure may use the attributes 'First and 'Last (written str'First and str'Last respectivly) to obtain the first and last indexes of the string passed in. So the implementation of Get_Line can limit the number of characters read to the size of the string passed in and return the actual number of characters read in "last". So in answer to your question the "Get_Line" procedure will make sure that the string you receive is a length of 10 or less. Steve (The Duck) "CheGueVerra" wrote in message news:mL5jb.3237$Z_2.269599@news20.bellglobal.com... > It's still not clear for me how to make sure, that when I have a String > let's say: > > S1 : String(1..10); > > How can I make sure that the String that I will receive and treat will be of > length 10 or less.. > > I'm still a little n00b > > CheGueVerra > > > >