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,d6c4537cf651710f X-Google-Attributes: gid103376,public From: je@bton.ac.uk (John English) Subject: Re: Type Conversion Date: 1997/12/08 Message-ID: <66i0vm$aab@saturn.brighton.ac.uk>#1/1 X-Deja-AN: 296485387 References: Organization: University of Brighton Newsgroups: comp.lang.ada Date: 1997-12-08T00:00:00+00:00 List-Id: Nick Davies (ndavies@comp.brad.ac.uk) wrote: : Can you help? I'm trying to do this : Token_Temp := Token_Temp & String(Current_Character); --Type Conversion : needed : Using:- : Token_Temp : String (1..20) := (others => ' '); : Current_Character : Character; The type conversion *shouldn't* be needed -- but what you're trying to do in the code above is to assign a 21-character string (20 chars in Token_Temp + 1 more char in Current_Character) to a 20-character string (Token_Temp). This *definitely* won't work. I don't know what you're trying to achieve, but it might be worth looking into the standard packages Ada.Strings.Bounded (RM95[A.4.4]) or possibly Ada.Strings.Unbounded (RM95[A.4.5]), since there are facilities there to deal with variable-length strings. ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.comp.it.bton.ac.uk/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------