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, LOTS_OF_MONEY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2e66fe8b30e3ee2c X-Google-Attributes: gid103376,public From: "Dr. Joachim Schr�er" Subject: Re: S'Write and How To Count Bytes Date: 2000/10/02 Message-ID: <8r9uf5$ocl@newsserv.vs.dasa.de>#1/1 X-Deja-AN: 676604337 References: <39D6891A.7DC448B6@acm.org> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Daimler-Benz Aerospace X-MSMail-Priority: Normal Newsgroups: comp.lang.ada Date: 2000-10-02T00:00:00+00:00 List-Id: I have not thought about the original question but there is a more elegant solution for your description. The 'read, 'write attributes are for constrained types. For unconstrained types (including tagged types/classwide types) there exist the 'input, 'output attributes. Note, that 'input is a function. If you want to overwrite 'input, 'output you just have to overwrite 'read, 'write cause they are used by the former. For this and input/output of access objects/linked datastructures you should look into the relevant chapter of Norman Cohens Ada95 version of "Ada as a second language" or into the Rationale, chapter A.4.1. J. Schroer David C. Hoos, Sr. schrieb in im Newsbeitrag: ... > If your record contains an unbounded string, I would in the My_Record'Write > procedure convert the unbounded string to a Standard.String, and write its > length to the stream with Natural'Write, followed by a call to String'Write. > This will put the length of the string on the stream, followed by the > string itself. > > Then, the My_Record'Read procedure would read the length from the stream, > using Natural'Read, use that length to declare a string of the proper size > (in a declare block), then read the string with String'Read. > Finally, you would convert the string to the unbounded string component in > your My_Record'Read's out parameter of type My_Record. > > > Marin David Condic wrote in message > news:39D6891A.7DC448B6@acm.org snip ...