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 autolearn=ham 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 03:00:52 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news2.telebyte.nl!news.jgaa.com!news.hacking.dk!pnx.dk!munin.nbi.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: count_string program Date: 27 Feb 2004 12:00:49 +0100 Organization: Munin Sender: sparre@sparre.crs4.it Message-ID: References: <403db7ee$1_1@news.tm.net.my> <403eb5f3$1_1@news.tm.net.my> NNTP-Posting-Host: 80.241.165.38 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.grove.home 1077879650 10026 80.241.165.38 (27 Feb 2004 11:00:50 GMT) X-Complaints-To: sparre@munin.nbi.dk NNTP-Posting-Date: Fri, 27 Feb 2004 11:00:50 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:5889 Date: 2004-02-27T12:00:49+01:00 List-Id: Cecilia Chew wrote: > > Cecilia Chew wrote: > >>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. > Isn't when i get the input from user, the characters will store in > (input(i)) variable? If not yet stored, what statement i need to add > in? In order to store the characters. I didn't write that you didn't store the characters entered. I just tried to get you to think about exactly what you needed. If you don't need all the characters entered later in the program, then you don't have to store them, and that makes the program much easier to write. > For the 2nd question above, I have no idea on it. Isn't once the > user push 'enter' button means their input is done. Sometimes. Other times they mark it by sending an end-of-file code. In the package Ada.Text_IO there are functions to check both if the user has sent an end-of-line code (pressed 'enter' on the keyboard) and to check if the user has sent an end-of-file code. The two functions are named: End_Of_Line and End_Of_File. Jacob -- LDraw.org Parts Tracker FAQ: http://www.ldraw.org/library/tracker/ref/faq/