comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos" <david.c.hoos.sr@ada95.com>
To: "Lele" <lele@libero.it>
Cc: "comp.lang.ada@ada.eu.org" <comp.lang.ada@ada-france.org>
Subject: Re: Send command to the Windows prompt from Ada procedure
Date: Wed, 25 Feb 2004 12:20:52 -0600
Date: 2004-02-25T12:20:52-06:00	[thread overview]
Message-ID: <mailman.23.1077733278.327.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: c1ijm9$gmp$1@e3k.asi.ansaldo.it


----- Original Message ----- 
From: "Lele" <lele@libero.it>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada-france.org>
Sent: Wednesday, February 25, 2004 10:48 AM
Subject: HELP: Send command to the Windows prompt from Ada procedure


> Hi,
> does anyone show me the simplest way to perform a windows system call
using
> Ada ?
> I've to call a batch file from my not-professional Ada procedure, or I've
to
> send command to the windows prompt (command.com) . How can I do that?
> Thanx for the advices.
>
Here is a library-level function that invokes the "system" function
of the C-runtime library.

with Interfaces.C;
function Execute_Shell_Command (Command : in String) return Integer
  is
    function Execute (Command : in Interfaces.C.char_array)
       return Interfaces.C.int;
    pragma Import (C, Execute, "system");
  begin --  Execute_Shell_Command
     return Integer (Run (Interfaces.C.To_C (Item => Command)));
end Execute_Shell_Command;




  reply	other threads:[~2004-02-25 18:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-25 16:48 HELP: Send command to the Windows prompt from Ada procedure Lele
2004-02-25 18:20 ` David C. Hoos [this message]
2004-02-26  8:50   ` Lele
2004-02-25 18:27 ` HELP: " tmoran
2004-02-26  9:48 ` Dmitry A. Kazakov
2004-02-27 13:22 ` Stephen Leake
replies disabled

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