From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: Mon, 8 Feb 1993 13:20 EST From: John McCormick Subject: Re: INFO-ADA Digest V93 #56 Message-ID: <01GUHB2EOPWG9QX30U@splava.cc.plattsburgh.edu> List-Id: In comp.lang.ada you write: >Could somebody tell me (email please) why this programme, >which compiles properly, seemingly stalls at the >line indicated? i.e. I type in a line followed by , >but nothing happens. What should happen is that this: >*:: >should be printed to the console, but isn't. And nothing >happens. The input prompt: >*>> >is printed, then I can type something, but after >nothing happens. :( >With Text_IO; Use Text_IO; >Procedure main is >instr, tokstr : String(1..255); String may not be the best data structure for your purpose. If the domain of instr and tokstr are small, an enumeration type is a better choice. You can instantiate an I/O package for your enumeration type. Its Get procedure acts more like the ones for numbers. No problems with mixing Gets and Get_Lines. No problems with line terminators. No problems with upper- or lowercase. You can even use the DATA_ERROR exception to validate your input. If you need a string later, there is always 'Image to convert enumeration values to string values. I always tell my students to try to use enumeration types rather than strings. John Note: 17 line signature follows =========================================================================== = John W. McCormick Phone (518) 564-2785 = = Computer Science Department FAX (518) 564-7827 = = State University of New York mccormjw@snyplava.bitnet = = Plattsburgh, NY 12901 mccormjw@splava.cc.plattsburgh.edu = = USA = = SUNY Plattsburgh = = where = = Computers + Model Railroading = Digitally Controlled Trains = = = = * * * = = * = = * = = ## ## T = = ######_########_########_#####_#########- = = o o o o o o o o oo OOOO oo\ = ===========================================================================