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