comp.lang.ada
 help / color / mirror / Atom feed
From: dewarr@my-dejanews.com
Subject: Re: Spawn()
Date: 1998/09/20
Date: 1998-09-20T00:00:00+00:00	[thread overview]
Message-ID: <6u2pm4$qqr$1@nnrp1.dejanews.com> (raw)
In-Reply-To: B229FC4896684F827@194.45.232.5

In article <B229FC4896684F827@194.45.232.5>,
  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.

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. The above
documentation *should* be all that an Ada programmer needs
to call Spawn, so the important thing is to fill in the
missing knowledge. You mention that you are confused with
"all those access types", but, assuming you basically know
what an access type *is*, it is not easy to guess exactly
what is confusing you.

The more precisely you can formulate your question, the
more accurate an answer can be given.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




  reply	other threads:[~1998-09-20  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-20  0:00 Spawn() Thomas Preymesser
1998-09-20  0:00 ` dewarr [this message]
1998-09-26  0:00   ` Spawn() Thomas Preymesser
1998-09-27  0:00     ` Spawn() dewarr
replies disabled

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