comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: Calling EXEs from ADA95
Date: 2000/03/23
Date: 2000-03-23T00:00:00+00:00	[thread overview]
Message-ID: <KjnC4.617$gg1.359650@newsread1.prod.itd.earthlink.net> (raw)
In-Reply-To: 022ad336.6a710f8a@usw-ex0109-066.remarq.com


SoVieTiK <r.lmejiaNOr.SPAM@unitec.edu.invalid> wrote in message
news:022ad336.6a710f8a@usw-ex0109-066.remarq.com...
> Can someone tell me how to call a executable (DOS) from
> ada?
In general, you can execute a shell command from an
Ada executable by means of an interface to the "system"
function from the C runtime library.

Here is a library-level procedure that does just that

with Interfaces.C;
function Execute_Shell_Command (The_Command_String : String)
      return Interfaces.C.Int is
   package C renames Interfaces.C;
   function System (S : C.Char_Array) return C.Int;
   pragma Import (C, System, "system");
begin
   return System (C.To_C (The_Command_String));
end Execute_Shell_Command;








  reply	other threads:[~2000-03-23  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-21  0:00 Calling EXEs from ADA95 SoVieTiK
2000-03-23  0:00 ` David C. Hoos, Sr. [this message]
2000-03-23  0:00 ` tmoran
replies disabled

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