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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!crdgw1!minerva!kassover From: kassover@minerva.crd.ge.com (David Kassover) Newsgroups: comp.lang.ada Subject: Re: Design/Development questions Message-ID: <8369@crdgw1.crd.ge.com> Date: 8 Jun 90 18:33:28 GMT References: <677@tfsg.UUCP> <67999@cc.utah.edu> Sender: news@crdgw1.crd.ge.com Organization: Aule-Tek, Inc. List-Id: In article <67999@cc.utah.edu> RCAPENER@cc.utah.edu writes: ... >Now that I have added my two bits on the above, all of which is totally >and purely subjective, I have a question to ask people on the net. >In VAX-Ada, the GET and the GET_LINE procedures have the very >disconcerting behavior that when you get a string, you must enter >the EXACT number of characters the string is declared for. Is this >behavior part of the LRM? Does anyone in NetLand have the equivalent >of C's fgets for strings in Ada? Any input (pun intended) on solving >this problem will be appreciated. We use, generally, the following interface to get_line, from package text_io, as shown in sys$sysroot:[syslib.adalib]text_io_.adc procedure GET_LINE(FILE : in FILE_TYPE; ITEM : out STRING; LAST : out NATURAL); LAST tells me how long the string actually is, We use this to load the string into the composite data structures we have built to actually manipulate strings Item must, of course, be long enough to handle any anticipated string, otherwise, presumably, we'd get a CONSTRAINT_ERROR or some such at run time. (Which means something has corrupted our files, or we really do need to make our strings bigger) This is probably not iron_clad. We have not yet had to deal with string lengths outside the range 0..256 I'm not near the manuals, so I can't tell if DEC considers this standard or an allowable interpretation. As far as dealing with C strings, we have routines that convert a C string to our Vstring, and vice versa. These routines are applied to the appropriate strings at the point where we call the C routines. -- David Kassover "Proper technique helps protect you against kassover@ra.crd.ge.com sharp weapons and dull judges." kassover@crd.ge.com F. Collins