comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Help with constructing an Ada Shell
Date: Fri, 30 Oct 2015 09:37:44 +0100
Date: 2015-10-30T09:37:44+01:00	[thread overview]
Message-ID: <871tccg3af.fsf@adaheads.sparre-andersen.dk> (raw)
In-Reply-To: 9e1e5dc4-f5e6-4d8d-9677-1b66117d8a85@googlegroups.com

annihilan@gmail.com writes:

>    Input : aliased String := (1 .. 255 => ' ');

> 	 IO.Get_Line(Input, Last);

>       Spawn (Program_Name => Input, -- truncate strings or Input(Input'First..Last)??

> No matter what command is passed at the prompt, a return value of 1 is
> given. 

Have you tried passing a command whose name is exactly 255 characters
long?

> I would massively appreciate any help that could be given to me. I
> don't really have any clue at all what's going on.

"Global" variables, which aren't really about maintaining state, are
generally a bad idea.

Why don't you give Execute_System the profile:

   function Execute_System (Program : in String) return Integer;

If GNAT.OS_Lib.Spawn wants access types as parameters, you can always
allocate a copy on the heap inside Execute_System and pass the access to
the copy to GNAT.OS_Lib.Spawn.

Greetings,

Jacob
-- 
                      CAUTION
               BLADE EXTREMELY SHARP
                KEEP OUT OF CHILDREN


  reply	other threads:[~2015-10-30  8:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30  4:53 Help with constructing an Ada Shell annihilan
2015-10-30  8:37 ` Jacob Sparre Andersen [this message]
2015-11-03  0:47   ` Nick Gordon
2015-10-30  9:10 ` Simon Wright
2015-10-30 13:52 ` David Botton
2015-10-30 23:19 ` Xavier Petit
replies disabled

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