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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,46ea53533b75e179 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-27 06:12:46 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nnx.oleane.net!oleane!jussieu.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: count_string program Date: 27 Feb 2004 08:28:59 -0500 Organization: Cuivre, Argent, Or Message-ID: References: <403db7ee$1_1@news.tm.net.my> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1077890850 4778 212.85.156.195 (27 Feb 2004 14:07:30 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 27 Feb 2004 14:07:30 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <403db7ee$1_1@news.tm.net.my> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:5896 Date: 2004-02-27T08:28:59-05:00 Cecilia Chew writes: > Hi all, > I am doing a program that will count the input characters from user. > There is a problem that I can't solve. > Problem is : since I'm going to count the characters. So, I can't ask > user how many characters they want to input. Compilation error come > and mention that the string need to be constrainted. > How am I going to constraint the string type since I don't know how > many characters user going to input. See Ada.Text_IO.Get_Line. For that, you need to know in advance the maximum number of characters the user might enter. Or, if you are using GNAT, see Ada.Strings.Unbounded.Text_IO (not a standard Ada package). Then you don't need a max in advance. -- -- Stephe