comp.lang.ada
 help / color / mirror / Atom feed
* Beginner issue..
@ 2013-06-16  6:54 Marcus F
  2013-06-16  7:00 ` Marcus F
  2013-06-16  7:30 ` Dirk Heinrichs
  0 siblings, 2 replies; 8+ messages in thread
From: Marcus F @ 2013-06-16  6:54 UTC (permalink / raw)


Hi!

I'm Marcus, I'm completely new to ADA but not to programming.
I'm looking at a simple tutorial guide to pick up some basics of ADA, but I ran into an issue that I don't understand.

Here's the trivial example I followed:

with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;
 
procedure Compute is

 procedure Double(Item : in out Integer) is
 begin -- procedure Double.
   Item := Item * 2;
 end Double;

 X : Integer := 1;   -- Local variable X of type Integer.

begin -- procedure Compute
 loop
  Put(X);
  New_Line;
  Double(X);
 end loop;
end Compute;


Now, I expect X to double once per loop, but when I build and run, I just get 0's scrolling down my screen.

Could someone help out a newbie?


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

end of thread, other threads:[~2013-06-16 18:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-16  6:54 Beginner issue Marcus F
2013-06-16  7:00 ` Marcus F
2013-06-16  7:21   ` Dmitry A. Kazakov
2013-06-16  7:52     ` Marcus F
2013-06-16  7:55       ` Marcus F
2013-06-16  8:49         ` Dmitry A. Kazakov
2013-06-16 18:32           ` Marcus F
2013-06-16  7:30 ` Dirk Heinrichs

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