From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,501858d4f6c6f9bc X-Google-Attributes: gid103376,public From: Samuel Tardieu Subject: Re: running an exe from gnat Date: 1997/03/17 Message-ID: #1/1 X-Deja-AN: 226172022 Sender: tardieu@esmeralda.enst.fr References: <332D3BD8.1AC5@ny.essd.northgrum.com> To: Mindy_matusewicz@ny.essd.northgrum.com Organization: TELECOM Paris Newsgroups: comp.lang.ada Date: 1997-03-17T00:00:00+00:00 List-Id: >>>>> "Mindy" == Mindy Matusewicz >>>>> writes: Mindy> I am running gnat for windows nt on my pentium and I need to Mindy> call an exe program. How do you do that in Ada? Just as you does in C, call for example the system() function. Something such as the following piece of code (untested) should do the job: with Interfaces.C.Strings; use Interfaces.C, Interfaces.C.Strings; [...] function Execute (Command : String) return int is C_Command : chars_ptr := New_String (Command); function C_System (Command : chars_ptr) return int; pragma Import (C, C_System, "system"); Result : constant int := C_System (C_Command); begin Free (C_Command); return Result; end Execute; Sam -- Samuel Tardieu -- sam@ada.eu.org