comp.lang.ada
 help / color / mirror / Atom feed
From: je@bton.ac.uk (John English)
Subject: Re: Type Conversion
Date: 1997/12/08
Date: 1997-12-08T00:00:00+00:00	[thread overview]
Message-ID: <66i0vm$aab@saturn.brighton.ac.uk> (raw)
In-Reply-To: Pine.GSO.3.95.971208215746.14902B-100000@dcsun4.comp.brad.ac.uk


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
-----------------------------------------------------------------




  reply	other threads:[~1997-12-08  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-08  0:00 Type Conversion Nick Davies
1997-12-08  0:00 ` John English [this message]
1997-12-09  0:00 ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
1998-11-01  0:00 Heather Wright
1998-11-01  0:00 ` dewarr
1998-11-01  0:00 ` Tucker Taft
1998-11-02  0:00 ` Marin David Condic
1998-11-02  0:00 ` Michael Kaufman
1998-11-03  0:00   ` Arun Mangalam
1998-11-06  0:00     ` Niklas Holsti
2014-10-11 23:56 type conversion compguy45
2014-10-12  0:07 ` compguy45
2014-10-12  0:25   ` compguy45
2014-10-12  0:33 ` Jeffrey Carter
2014-10-12  0:38   ` compguy45
2014-10-12  3:45     ` Jeffrey Carter
2014-10-12  2:32 ` Shark8
2014-10-12  4:53   ` Anh Vo
2014-10-12  4:57     ` Shark8
2014-10-12  5:41       ` Anh Vo
2014-10-12  6:38       ` Jeffrey Carter
2014-10-12  9:37       ` Pascal Obry
2014-10-12 11:54         ` compguy45
2014-10-12 23:05         ` Georg Bauhaus
2014-10-13  5:40           ` Pascal Obry
2014-10-13  7:26           ` Simon Wright
2014-10-13 22:36           ` Randy Brukardt
2014-10-12  9:16   ` Simon Wright
2014-10-12 21:05     ` Shark8
2014-10-12  9:31 ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox