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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9e47ad8d460f46b8 X-Google-Attributes: gid103376,public From: jmoor@my-deja.com Subject: Re: Extracting Fields in Files Date: 2000/01/14 Message-ID: <85nfks$be$1@nnrp1.deja.com>#1/1 X-Deja-AN: 572575176 References: <200001140610.HAA09245@bulgaria.otn.eurocopter.de> X-Http-Proxy: 1.0 DCC-PROXY, 1.0 x29.deja.com:80 (Squid/1.1.22) for client 209.49.118.18 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Jan 14 15:33:48 2000 GMT X-MyDeja-Info: XMYDJUIDjmoor Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) Date: 2000-01-14T00:00:00+00:00 List-Id: In article <200001140610.HAA09245@bulgaria.otn.eurocopter.de>, comp.lang.ada@ada.eu.org wrote: > that reading exactly 212 characters will leave the LF (the end of line on > Unix, i.e. end of record, as you call it) unread. So your next get_line simply > reads the LF and returns an empty line. > > As a simple work-around declare > > rec01: String (1..213); > > (one longer than the maximum expected length) and a get_line will always > swallow the LF. > > I increased the length of the rec01 string to 213 as you suggested. I printed a report showing record number, type, and length returned from get_line and that program modification did stop get_line from returning an empty line. The report also showed that record 193 was an inappropriate length for the type (in Cobolese "wrong length record"). The program prematurely goes to end of job after reading record 193. Wouldn't you think that an exception would have been raised? Even if I wrote a routine that trapped "wrong length records" how could I bypass the "record"? Did the program stop after reading the record because it truly sensed an end of file condition or because it sensed an exception? Learning a new language is not easy (esp. for old dogs). Sent via Deja.com http://www.deja.com/ Before you buy.