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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1d2825e3bbbe82fb X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Need help bad!!!!! Date: 1996/10/27 Message-ID: <01bbc402$6c7b01c0$088371a5@dhoossr.iquest.com>#1/1 X-Deja-AN: 192477826 distribution: world references: <54u8m2$ko1@news.cdsnet.net> content-type: text/plain; charset=ISO-8859-1 organization: DBH Enterprises, Inc. mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-10-27T00:00:00+00:00 List-Id: You need to be using Text_IO.Get_Line which has parameters both for the string into which you write, and a parameter "Last : out Natural", which is set to the last character in the string which was set by the operation. Get_Line terminates on either the exhaustion of the space in the provided string, or the end of the input line (whether from a disk file or the keyboard (note that there are overloaded versions of Get_Line). Then, if you test for Last = My_string'Last, you will know that there may be more characters on the line than My_String provides. If the equality test fails, then the slice of the string you want is My_String (1 .. Last). The Ada Language Reference Manual makes this all abundantly clear. The Reference manuals for both Ada95 and Ada83 (along with an abundance of other reference material are available in hypertext format at "http://adahome.com/Resources/References.html" It would really be nice if we could get people to read the LRM before posting questions, but, alas, I find in my work in industry that even people who have been programming for years are too lazy to look it up if there's someone nearby handy to ask. -- David C. Hoos, Sr., http://www.dbhwww.com http://www.ada95.com BlacKnight wrote in article <54u8m2$ko1@news.cdsnet.net>... > This is going to sound really stupid, and I'm extremely frustrated because I > know there has to be a simple answer to this: > > I have a linked list lab I've been working on for college. I've gotten > the sort, etc working, except for 3 procedures that depend on this problem I'm > having. I need to have the user input a name (name : string(1..20);) to do one > of 3 options, add a record, display a records info, or delete the record. I've > been reading the input a character at a time and using an if condition to check > for Ascii.LF so the program can take whats entered and store it in name, and > then continue with the option selected. I can't get the program to accept any > type of carriage return, it always wants 20 characters no matter what. So the > user has to hit the space bar after entering the name until 20 cells in the > string are filled. I've tried unbounded_strings, ascii values, comparisons, > conditions, get_line(), get(), even dropped the code for get_line out of > gnat.io. None of this works. If anyone has some help, please post or email me > at : amolthan@cdsnet.net > > Thanks alot, > Alex > >