* Use procedure(s) in a function ?
@ 2015-12-15 20:29 comicfanzine
2015-12-15 22:20 ` Simon Wright
0 siblings, 1 reply; 4+ messages in thread
From: comicfanzine @ 2015-12-15 20:29 UTC (permalink / raw)
Hi ;
Is it possible to use procedure(s) in a function ??
I Checked the A.R.M = http://www.adaic.org/resources/add_content/standards/95lrm/ARM_HTML/RM-6-4.html
http://www.adaic.org/resources/add_content/standards/95lrm/ARM_HTML/RM-6-3.html
No examples about this....
If yes =
I'm trying to return a global variable's String value , and want to use the function later in a procedure .
The code =
function get_name return String
is begin
Put_line("Your name?");
Get(name); -- name is in "globals"
put(name);
return name;
end get_name;
package globals
is
name : String(1..20) ;
end globals;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Use procedure(s) in a function ?
2015-12-15 20:29 Use procedure(s) in a function ? comicfanzine
@ 2015-12-15 22:20 ` Simon Wright
2015-12-16 1:51 ` comicfanzine
0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2015-12-15 22:20 UTC (permalink / raw)
comicfanzine@gmail.com writes:
> Is it possible to use procedure(s) in a function ??
Yes.
You should really try one of the on-line tutorials rather than the ARM,
which isn't designed as a teaching resource.
See http://www.adaic.org/learn/materials/#tutorials - the "Ada Lovelace
Tutorial" and "Ada - A Crash Course" both look good.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Use procedure(s) in a function ?
2015-12-15 22:20 ` Simon Wright
@ 2015-12-16 1:51 ` comicfanzine
2015-12-18 4:31 ` comicfanzine
0 siblings, 1 reply; 4+ messages in thread
From: comicfanzine @ 2015-12-16 1:51 UTC (permalink / raw)
Edit = I made a mistake in the topic .
Of course its possible to use a procedure in a function , like Put(); for instance .
But , when i use this procedure in the function =
procedure Get (Item : out String);
At launching , no get is executing , the program "create" a "skip" line .
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Use procedure(s) in a function ?
2015-12-16 1:51 ` comicfanzine
@ 2015-12-18 4:31 ` comicfanzine
0 siblings, 0 replies; 4+ messages in thread
From: comicfanzine @ 2015-12-18 4:31 UTC (permalink / raw)
Solved .
I would be better , if i could modify the topic subject but there is not this option .
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-12-18 4:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-15 20:29 Use procedure(s) in a function ? comicfanzine
2015-12-15 22:20 ` Simon Wright
2015-12-16 1:51 ` comicfanzine
2015-12-18 4:31 ` comicfanzine
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox