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.4 required=5.0 tests=BAYES_00,FROM_DOMAIN_NOVOWEL autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,36c55584044f4f0f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-08 10:34:21 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-peer.gip.net!news.gsl.net!gip.net!snoopy.risq.qc.ca!wesley.videotron.net!wagner.videotron.net.POSTED!not-for-mail From: "Gep" Newsgroups: comp.lang.ada References: <3DF2AD96.6010100@acm.org> Subject: Re: string manipulation X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Sun, 8 Dec 2002 13:34:14 -0500 NNTP-Posting-Host: 24.200.43.55 X-Complaints-To: abuse@videotron.ca X-Trace: wagner.videotron.net 1039372453 24.200.43.55 (Sun, 08 Dec 2002 13:34:13 EST) NNTP-Posting-Date: Sun, 08 Dec 2002 13:34:13 EST Xref: archiver1.google.com comp.lang.ada:31554 Date: 2002-12-08T13:34:14-05:00 List-Id: "Jeffrey Carter" wrote in message news:3DF2AD96.6010100@acm.org... > Gep wrote: > > > > while not valid > > loop > > get_line(V_string, V_length); > > > > if V_length= V_string'length then > > Skip_Line; > > Valid := True; > > else > > valid :=false; > > Put("invalid"); > > end if; > > end loop; > > This looks better then that other code. You can do this. It will > repeatedly get a line until it gets one that is exactly V_String'Length > characters. If that's what you want. I don't see what it has to do with > declaring a string variable of a specific length. > > Valid is sort of useless here, as well as providing an opportunity for > errors. You can forget to assign to it, or assign the wrong value. I > think this would read better without it: > > loop > Get_Line (...); > > if V_Length = V_String'Length then > Skip_Line; > > exit; > end if; > > Put ("invalid"); > end loop; > What I wanted is a procedure that couldget both, a string with a fixed length or a variable length. But it is ok I'm gonna done do two seprate procedures. I thnik it is going to be more clear that way thanks anyway for help.