From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Help with constructing an Ada Shell Date: Fri, 30 Oct 2015 09:37:44 +0100 Organization: JSA Research & Innovation Message-ID: <871tccg3af.fsf@adaheads.sparre-andersen.dk> References: <9e1e5dc4-f5e6-4d8d-9677-1b66117d8a85@googlegroups.com> NNTP-Posting-Host: 109.57.156.148.mobile.3.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: loke.gir.dk 1446194264 32608 109.57.156.148 (30 Oct 2015 08:37:44 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 30 Oct 2015 08:37:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:Mp75HvyiS0UigKXdKOR8HE/cMUY= Xref: news.eternal-september.org comp.lang.ada:28122 Date: 2015-10-30T09:37:44+01:00 List-Id: 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