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,691bbbf0ab0cc67e X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: [Q] Returning Strings From A Function Date: 1997/04/05 Message-ID: #1/1 X-Deja-AN: 230966826 References: <33454165.1658515@news.demon.co.uk> <33468b81.762963@news.demon.co.uk> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-04-05T00:00:00+00:00 List-Id: John McCabe said <> John, it is still very difficult to understand what you are asking for. Your code above makes perfect sense if you want File_Name to be 12 characters long, and of course the assignment will check for 12 characters. That is apparently NOT what you want, so it is not clear what "this" is that is "obviously impossible". You need to say what you have in mind. Do you want to pad the name with blanks to make the length 12? In that case you could write File_name := Ada.Strings.Fixed.Head (Text_IO.Name (File), File_Name'Length)); which seems pretty clear. If you what you wanted was a string whose maximum length was 12, but to which smaller strings could be assigned, then Ada.Strings.Bounded is just the ticket. It is simply not at all clear to me from the above code what you have in mind. When you write some perfectly legal, perfectly sensible Ada code, and say "What I wanted was to do that, but it is impossible, you are obviously trying to say that you expected some other semantics from the code than the semantics defined in Ada. That's fine, anyone is allowed to say such things, and it is often interesting to know what features people want, but it is inmpossible to *guess* from this perfectly reasonable Ada code what you wanted it to do that was different from what it actually does in Ada. So why not try again saying exactly what you have in mind in a clear form. Don 't try to write Ada, since apparently you think you can't do what you want to in Ada. Instead describe informally what it is that you think you cannot do that you would like to do.