[Gambas-user] Process_Kill and LAST

Benoit Minisini gambas at ...1...
Fri Jan 23 16:38:08 CET 2004


On Friday 23 January 2004 05:44, Rob wrote:
> I just noticed tonight that if you refer to LAST.Id or
> LAST.Handle in the Process_Kill() event handler, they both
> always return -1.  This kinda makes it difficult to figure out
> which process got terminated.  Was this an oversight?
>
> The following code in a blank form will demonstrate this one
> pretty well.
>
> ' Gambas class file
>
> PUBLIC SUB Form_Open()
>
>   SHELL "ls -al" FOR READ
>
> END
>
> PUBLIC SUB Process_Kill()
>
>   Message.info("Process " & LAST.id & " is gone.")
>
> END
>
>
> I have also had LAST.Id and LAST.Handle be -1 during the last
> call of Process_Read(), but not repeatably.
>
> Rob
>

When a child terminated, LAST.Handle (which is the same thing as LAST.Id) is 
immediately reset to -1.

I will remove this reset, so that the process pid can be read in 
Process_Kill().

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...





More information about the User mailing list