From: anon@anon.org (anon)
Subject: Re: Example of Spawn call
Date: Sat, 02 May 2009 18:28:35 GMT
Date: 2009-05-02T18:28:35+00:00 [thread overview]
Message-ID: <nh0Ll.188291$4m1.121384@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 7cc6117d-689f-41ef-be05-882a7b5453a7@y34g2000prb.googlegroups.com
I am not the guy that ask for help. My example worked for the simple version
of spawn.
I think the first guy "Daniel" who ask for help forgot to use the
"Argument_String_To_List" routine to build the agument list. Even if
there is no arguments he should call "Argument_String_To_List"
and give it a null string ( "" ) to insure that the parameter is correct
for the "spawn" call.
In <7cc6117d-689f-41ef-be05-882a7b5453a7@y34g2000prb.googlegroups.com>, Hang <xiehang@gmail.com> writes:
>On 5=D4=C21=C8=D5, =CF=C2=CE=E711=CA=B128=B7=D6, a...@anon.org (anon) wrote=
>:
>> with Ada.Text_IO ;
>> use Ada.Text_IO ;
>>
>> with GNAT.OS_Lib ; -- Could be System.OS_Lib
>> use GNAT.OS_Lib ;
>>
>> procedure test is
>>
>> Program_Name : String :=3D "temp.exe" ;
>> Args : Argument_List_Access ;
>> Success : Boolean ;
>>
>> begin -- test
>>
>> -- Create argument list.
>>
>> Args :=3D Argument_String_To_List ( " First -second 3" ) ;
>>
>> Spawn ( Program_Name, Args.all, Success ) ;
>> if Success then
>> Put_Line ( "Temp was Spawned Correctly" ) ;
>> else
>> Put_Line ( "ERROR: Spawn" ) ;
>> end if ;
>> end test ;
>>
>> --
>> -- Spawned program. May require open/close calls for checking output
>> --
>> with Ada.Command_Line ;
>> use Ada.Command_Line ;
>> with Ada.Text_IO ;
>> use Ada.Text_IO ;
>>
>> procedure temp is
>>
>> begin
>> for Index in 1 .. Argument_Count loop
>> Put ( Index'img ) ;
>> Put ( " =3D> " ) ;
>> Put_Line ( Argument ( Index ) ) ;
>> end loop ;
>> end temp ;
>>
>> In <50d832b4-140d-4029-8d7c-939711516...@u8g2000yqn.googlegroups.com>, da=
>niel.wenge...@home.se writes:
>>
>> >Though not an Ada issue, really, someone here might have had the same
>> >problem as I have had: I tried to make a small program start another
>> >program using System.OS_Lib.Spawn. However, it raised Program_Error
>> >and stated Exception_Access_Violation.
>>
>> >Any ideas why, and what to do about it?
>>
>> >/D
>>
>>
>
>I'm not seeing any problem:
>
>C:\GNAT\Projects\test>test
> 1 =3D> First
> 2 =3D> -second
> 3 =3D> 3
>Temp was Spawned Correctly
>
next prev parent reply other threads:[~2009-05-02 18:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-01 21:39 GNAT on WinXP: System.OS_Lib.Spawn raises Program_Error daniel.wengelin
2009-05-01 21:58 ` Jeffrey R. Carter
2009-05-02 4:16 ` anon
2009-05-02 15:59 ` Martin
2009-05-02 20:39 ` anon
2009-05-02 22:01 ` Ed Falis
2009-05-02 23:20 ` anon
2009-05-03 13:24 ` Ed Falis
2009-05-04 0:22 ` anon
2009-05-04 1:21 ` Ed Falis
2009-05-03 10:33 ` sjw
2009-05-03 13:27 ` Ed Falis
2009-05-04 13:32 ` Robert A Duff
2009-05-03 9:42 ` Martin
2009-05-05 0:04 ` Randy Brukardt
2009-05-05 2:43 ` anon
2009-05-05 8:06 ` Martin
2009-05-05 23:40 ` Randy Brukardt
2009-05-02 20:31 ` daniel.wengelin
2009-05-03 2:22 ` Hang
2009-05-02 6:28 ` Example of Spawn call anon
2009-05-02 15:50 ` Hang
2009-05-02 18:28 ` anon [this message]
2009-05-02 19:38 ` sjw
2009-05-02 19:47 ` sjw
2009-05-02 20:59 ` anon
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox