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-Thread: a07f3367d7,92ac415bbb0f451b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: How to read records as strings? Date: Thu, 29 Sep 2011 20:28:39 -0400 Organization: The Wasteland Message-ID: References: <1fdacb1d-d67f-4f2a-8d6a-1bdedf2754a9@z19g2000vby.googlegroups.com> NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:21183 Date: 2011-09-29T20:28:39-04:00 List-Id: In article <1fdacb1d-d67f-4f2a-8d6a-1bdedf2754a9@z19g2000vby.googlegroups.com>, pack2themoon wrote: > Hi, everyone, I'm a beginner, and I don't have a solid understanding > of object-oriented programming. For a homework, I need to read the > following record as strings from a file. In the next steps, I need to > know the "length" of each word to facilitate the processing like > "reverse", adding numbers...etc. > > Can I use the "length" function of bounded-string? how to use generic > package, can anyone give me the structure of the whole program(like > where to use, with package, where to begin..)? Thank you so much!!! > > > Alice 0001 95 96 > Bob 0002 85 86 > Cathy 0003 75 76 > David 0004 65 66 > Edward 0005 85 86 > Frank 0006 77 78 As this is homework, your instructor and textbook may have some specific things that you should already know and apply to solve this problem. I always start by creating a Short, Self Contained, Correct (Compilable), Example [1]. You might study these file I/O examples [2] and post your own SSCCE here for more comments and guidance. Out of curiosity, what text are you using? [1] [2] -- John B. Matthews trashgod at gmail dot com