comp.lang.ada
 help / color / mirror / Atom feed
* How do i print stuff?
@ 2017-10-28 18:07 tclwarrior
  2017-10-28 18:30 ` Niklas Holsti
  0 siblings, 1 reply; 3+ messages in thread
From: tclwarrior @ 2017-10-28 18:07 UTC (permalink / raw)


Hi,

This is my first day learning Ada 
I know other languages (Mainly Perl and SQL) 
So I am not total newbie

Anyway, 

After that I saw this tweet https://twitter.com/shishini/status/924328446490218496 
I decided that my first program, would be exactly that 

I came up with this 

-- Code
with Ada.Text_IO;


procedure Main is
   a : Float := (0.3 - 0.2);
   b : Float := (0.2 - 0.1);
   c : Boolean := (a=b);
begin
   if c then
      Ada.Text_IO.Put_Line("true");
   else 
      Ada.Text_IO.Put_Line("false");
   End if;
      
end Main;
-- Code 

Which at least show me that Ada is more like Go and D 

But, I failed miserable to simply Print a, b and c 
well, I kind of succeeded in printing a and b using 
Float_Text_IO.Put 

But could not find a way to Print c (a boolean)

Well, so my question, that is the strategy to print stuff in Ada 
does have have a print statement that can print any type 
does each type have his one print statement 
Should I cast all types to strings and print them using Text_IO
How do I cast floats and booleans to strings?

Thanks
Ali


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

end of thread, other threads:[~2017-10-28 18:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-28 18:07 How do i print stuff? tclwarrior
2017-10-28 18:30 ` Niklas Holsti
2017-10-28 18:52   ` Niklas Holsti

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