comp.lang.ada
 help / color / mirror / Atom feed
* How to start another application within an ADA program?
@ 2013-11-26 10:50 tolkamp
  2013-11-26 11:10 ` Graham Stark
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tolkamp @ 2013-11-26 10:50 UTC (permalink / raw)


Is it possible to start an other apllication (eg Microsoft Word) within an ADA program? If so, how do I do it?

I tried to select the executable file with the JEWL File-Browser, but this did not work. 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to start another application within an ADA program?
  2013-11-26 10:50 How to start another application within an ADA program? tolkamp
@ 2013-11-26 11:10 ` Graham Stark
  2013-11-26 12:29 ` Rego, P.
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Graham Stark @ 2013-11-26 11:10 UTC (permalink / raw)


On Tuesday, 26 November 2013 10:50:15 UTC, tolkamp  wrote:
> Is it possible to start an other apllication (eg Microsoft Word) within an ADA program? If so, how do I do it?
> 
> 
> 
> I tried to select the executable file with the JEWL File-Browser, but this did not work.

I don't think there's anything for this in the standard library.

If you're using Gnat, look at the Spawn and Non_Blocking_Spawn functions in Gnat.OS_Lib.

Graham


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to start another application within an ADA program?
  2013-11-26 10:50 How to start another application within an ADA program? tolkamp
  2013-11-26 11:10 ` Graham Stark
@ 2013-11-26 12:29 ` Rego, P.
  2013-11-26 13:00 ` Jacob Sparre Andersen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Rego, P. @ 2013-11-26 12:29 UTC (permalink / raw)


On Tuesday, November 26, 2013 8:50:15 AM UTC-2, tolkamp wrote:
> Is it possible to start an other apllication (eg Microsoft Word) within an ADA program? If so, how do I do it?
> 
> 
> 
> I tried to select the executable file with the JEWL File-Browser, but this did not work.

Yes.

Look at this thread (you can also look for "system_call").
https://groups.google.com/d/msg/comp.lang.ada/6G-4zAkBUuo/c248P5xhQvoJ

[]s

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to start another application within an ADA program?
  2013-11-26 10:50 How to start another application within an ADA program? tolkamp
  2013-11-26 11:10 ` Graham Stark
  2013-11-26 12:29 ` Rego, P.
@ 2013-11-26 13:00 ` Jacob Sparre Andersen
  2013-11-26 14:31 ` Dmitry A. Kazakov
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Jacob Sparre Andersen @ 2013-11-26 13:00 UTC (permalink / raw)


tolkamp <f.tolkamp@gmail.com> writes:

> Is it possible to start an other apllication (eg Microsoft Word)
> within an ADA program?

Yes.  (And Ada is not an acronym.)

> If so, how do I do it?

POSIX.Process_Primitives.Start_Process

Greetings,

Jacob
-- 
"Nobody writes jokes in base 13."
 Douglas Adams


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to start another application within an ADA program?
  2013-11-26 10:50 How to start another application within an ADA program? tolkamp
                   ` (2 preceding siblings ...)
  2013-11-26 13:00 ` Jacob Sparre Andersen
@ 2013-11-26 14:31 ` Dmitry A. Kazakov
  2013-11-26 20:42 ` gautier_niouzes
  2013-11-27 15:25 ` Thomas Løcke
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry A. Kazakov @ 2013-11-26 14:31 UTC (permalink / raw)


On Tue, 26 Nov 2013 02:50:15 -0800 (PST), tolkamp wrote:

> Is it possible to start an other apllication (eg Microsoft Word) within an
> ADA program? If so, how do I do it?

1. You can use whatever system calls available. E.g. UNIX's system/exec* or
Windows' CreateProcess. For the latter use Win32 bindings available with
GNAT.

2. A portable way to do it is, already mentioned, GNAT's OS library, or GTK
(Glib). Here is the bindings:

http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#10

You can feed the spawned process' input and catch its output directly or
using GTK's text buffers.

I believe that Qt also has some means to spawn processes.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to start another application within an ADA program?
  2013-11-26 10:50 How to start another application within an ADA program? tolkamp
                   ` (3 preceding siblings ...)
  2013-11-26 14:31 ` Dmitry A. Kazakov
@ 2013-11-26 20:42 ` gautier_niouzes
  2013-11-27 15:25 ` Thomas Løcke
  5 siblings, 0 replies; 7+ messages in thread
From: gautier_niouzes @ 2013-11-26 20:42 UTC (permalink / raw)


As a complement to other answers, perhaps you want to start an application exactly like Windows does when you do Window-key-R or "start [something]" from the command line cmd.exe. For instance "start winword" will start MS Word (even though winword.exe is not in the path), and "start mydoc.doc" will start MS Word and open mydoc.doc as well in it.
In that case, look for "Start" in
http://sf.net/p/texcad/code/HEAD/tree/tc_gwin/gwin_util.ads
http://sf.net/p/texcad/code/HEAD/tree/tc_gwin/gwin_util.adb
HTH
_________________________
Gautier's Ada programming
http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a valid e-mail address


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to start another application within an ADA program?
  2013-11-26 10:50 How to start another application within an ADA program? tolkamp
                   ` (4 preceding siblings ...)
  2013-11-26 20:42 ` gautier_niouzes
@ 2013-11-27 15:25 ` Thomas Løcke
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Løcke @ 2013-11-27 15:25 UTC (permalink / raw)


On 11/26/2013 11:50 AM, tolkamp wrote:
> Is it possible to start an other apllication (eg Microsoft Word) within an ADA program? If so, how do I do it?


Another option is the GNATCOLL.Scripts package:

http://docs.adacore.com/gnatcoll-docs/scripting.html

I know it's not exactly what you're asking for, but it does provide a
method to start an external proces.

:o)

-- 
Thomas Løcke | thomas@12boo.net | http://12boo.net


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-11-27 15:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-26 10:50 How to start another application within an ADA program? tolkamp
2013-11-26 11:10 ` Graham Stark
2013-11-26 12:29 ` Rego, P.
2013-11-26 13:00 ` Jacob Sparre Andersen
2013-11-26 14:31 ` Dmitry A. Kazakov
2013-11-26 20:42 ` gautier_niouzes
2013-11-27 15:25 ` Thomas Løcke

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