comp.lang.ada
 help / color / mirror / Atom feed
* Type Conversion
@ 1997-12-08  0:00 Nick Davies
  1997-12-08  0:00 ` John English
  1997-12-09  0:00 ` Stephen Leake
  0 siblings, 2 replies; 30+ messages in thread
From: Nick Davies @ 1997-12-08  0:00 UTC (permalink / raw)




	Hi guys,
	
		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;

	and I keep getting the error message:-

		scanner_main.adb:64:44: illegal operand for array conversion
		gnatmake: "scanner_main.adb" compilation error

		Thanks in advance,

			Nick

    ************************************
                Nick Davies
             2nd Year Comp.Sci
	
      e-mail : ndavies@comp.brad.ac.uk
    ************************************





^ permalink raw reply	[flat|nested] 30+ messages in thread
* Type Conversion
@ 1998-11-01  0:00 Heather Wright
  1998-11-01  0:00 ` dewarr
                   ` (3 more replies)
  0 siblings, 4 replies; 30+ messages in thread
From: Heather Wright @ 1998-11-01  0:00 UTC (permalink / raw)


Probably a really lame question, but what is the syntax for type conversion
in Ada?

I'm trying to convert a float to an int (or vice-versa if necessary), the
help files are doing
me no good and the closest thing I found online was a comparison between
type conversion and
qualifier.

Yeah, I'm a complete Newbie at Ada.

Thanks very much for any help,

Heather






^ permalink raw reply	[flat|nested] 30+ messages in thread
* type conversion
@ 2014-10-11 23:56 compguy45
  2014-10-12  0:07 ` compguy45
                   ` (3 more replies)
  0 siblings, 4 replies; 30+ messages in thread
From: compguy45 @ 2014-10-11 23:56 UTC (permalink / raw)


I have function...

myFunction that given string returns array of integers....lets call that array a

I have another function myOtherFunction that takes string as parameter....just for simplicity i am trying to do following....

myFunction(Integer'Image(a(1)));  -- compiler error

I tried also myFunction(Integer'Value(a(1))); -- error again

I know in other languages you could do var $d = String($someInt);

Obviously Ada can do same but online I was able to find only 2 solutions above but none worked.


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2014-10-13 22:36 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-08  0:00 Type Conversion Nick Davies
1997-12-08  0:00 ` John English
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

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