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,70dee47014cd7083 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: How do I allocate strings of variable length at runtime? Date: 1997/10/07 Message-ID: #1/1 X-Deja-AN: 278506487 References: <342bbda6.153101@news.rmi.de> <342FDBDA.67D8427E@linkabit.titan.com> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1997-10-07T00:00:00+00:00 List-Id: In article <342FDBDA.67D8427E@linkabit.titan.com> Marc Bejerano writes: > Just use Ada.Strings.Unbounded and when you need to call > Text_IO.Open simply pass it the To_String version of your > variable. Correct, very correct! ;-) > This will solve your dilemma regarding the blanks at he end of the string. Note that this solves the dilemma by eliminating it completely. Unbounded strings are an abstract type which have the property of a current length, but no concept of padding. Exactly what you want. The actual implementation may or may not be complex, but the author doesn't even have to think about that. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...