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=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,dea5cfbb62015319 X-Google-Attributes: gid103376,public From: tp@odn.de (Thomas Preymesser) Subject: Re: Spawn() Date: 1998/09/26 Message-ID: <360cf12c.25420365@news.nuernberg.odn.de>#1/1 X-Deja-AN: 395081822 References: <6u2pm4$qqr$1@nnrp1.dejanews.com> Organization: ODN Onlinedienst Nordbayern GmbH Newsgroups: comp.lang.ada Date: 1998-09-26T00:00:00+00:00 List-Id: On Sun, 20 Sep 1998 11:41:56 GMT, dewarr@my-dejanews.com wrote: Hi. >In article , > t.preymesser@msn.sub.org (Thomas Preymesser) wrote: >> Hi. >> >> Can someone show me an example how to use the procedure >> "Spawn" in gnat? >> I'm a little bit confused with these access-types. > >The documentation on how to use such routines is always >found in the package specification in the corresponding >g-xxx.ads file (use gnatkr to find the file name): > > type Argument_List is array (Positive range <>) of String_Access; > -- Type used for argument list in call to Spawn. The lower bound > -- of the array should be 1, and the length of the array indicates > -- the number of arguments. > > type Argument_List_Access is access all Argument_List; > -- Type used to return an Argument_List without dragging in secondary > -- stack. > > procedure Spawn > (Program_Name : String; > Args : Argument_List; > Success : out Boolean); > -- The first parameter of function Spawn is the full path name of the > -- executable. The second parameter contains the arguments to be passed > -- to the program. Success is false if the program could not be spawned > -- or its execution completed unsuccessfully. Note that the caller will > -- be blocked until the execution of the spawned program is complete. yes, i have read these specs but they don't describe how to use the procedures - they describe the function of a procedure/function and the types of the parameters. >Rather than give an example, which then is likely to get >copied without real understanding, why not ask a specific >question as to what is unclear in the above. OK, how can i convert a list of Parameters of type string to a variable of type Parameter_List? What�s the problem with giving an example for a specific function-call? Nearly all man-pages of C-functions shows an example of how to use the function? > The above >documentation *should* be all that an Ada programmer needs >to call Spawn, Sure, but i am an experienced C programmer, not an experienced Ada programmer who knows all aspects of the Ada language. -Thomas