[Gambas-user] multible Processes

Benoit Minisini gambas at ...1...
Tue Dec 9 20:44:00 CET 2003


On Monday 08 December 2003 21:15, Charlie Reinl wrote:
> Salut,
>
> I want to write a small programm in gambas, where i compare the output from
> EXEC and SHELL .
>
> so I dit:
>
> PRIVATE myShellProcess AS Process
> PRIVATE myEXECProcess AS Process
>
>
> - made two Textboxes for input
> One for the command , and one for the arguments.
>
> - I made 4 Output Textboxes a OUTput for read and one for Error and that
> twice for Exec and SHELL
>
> - a Button [Fire] shall starts all :
>
> PUBLIC SUB btnFire_Click()
> DIM sSHELLText AS String
>    EXECFeedback.Text = ""
>    SHELLFeedback.Text = ""
>    EXECError.Text = ""
>    SHELLError.Text = ""
>    'Trim strips the whitespaces from a string
>    IF Trim(InputCom.Text)<> "" THEN
>          ' call it with EXEC
>          EXEC [Trim(InputCom.Text),Trim(InputArguments.Text)] FOR READ
> WRITE AS myEXECProcess
>          ' call it with SHELL
>          sSHELLText = Trim(InputCom.Text)+" " + Trim(InputArguments.Text)
>          SHELL  sSHELLText FOR READ WRITE AS myShellProcess
>    ELSE
>       EXECError.Text = "please enter a program to execute"
>       SHELLError.Text = EXECError.Text
>    ENDIF
> END
>
> But how can I catch the Output(s)
>
> ??? PUBLIC SUB Process_Read()
> ??? PUBLIC SUB Process_Error(sStr AS String)
>
> Have I to catch the Process.Id for make the difference ?
>
> Thanks for any hint.
>
> amicalement
> Charlie
>
>

Use the LAST keyword to get the process that raises the event in 
Process_Read() or Process_Error().

Regards,

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





More information about the User mailing list