On 22 Apr 2010, at 14:00,
Riccardo Corradini wrote:
> Sure,
> but the example is not mine
> 'cause is taken from
>
http://forum.ubuntu-it.org/index.php?topic=111537.msg756738>
> PUBLIC processo AS Process
>
> PUBLIC SUB Form_Open()
>
> StartOctave()
>
> END
>
> PUBLIC SUB Process_Read()
>
> DIM sLine AS String
>
> READ #processo, sLine, - Lof(processo)
>
> Terminale.Text = Terminale.Text & sLine
>
> END
>
> PUBLIC SUB StartOctave()
>
> Processo = SHELL "octave" FOR INPUT OUTPUT
>
> END
>
>
> PUBLIC SUB Button1_Click()
>
> PRINT #Processo, Comando.Text
>
>
END
>
>
> The function StartOctave runs the process and links pipes
> (Processo = SHELL "octave" FOR INPUT OUTPUT)
> In this way I can read and write over a process like if it were a file
> With the function Button1_Click() I print the commands that the
> users writes over the process (it is a just a sort of terminal)
> While Process_Read is the function that controls if there is
> something to read over the stream process and adds it to text-box
> "terminale" in order to visualize it.
>
> Hope my rough translation will be useful to the community.
> Bests
> Riccardo Corradini
Riccardo,
Thanks for the example.
Communication via pipes might work for simple cases but
is much less powerful than embedding Octave.
Therefore, I beleive using Gambas gives no advantage at all compared
to building the GUI in
python as suggested by Jaroslav,
while it has lots of disadvantages in terms of speed, memory and
flexibility.
c.