[Gambas-user] Send data to the process

Bruce Steers bsteers4 at gmail.com
Sat Apr 24 19:48:55 CEST 2021


Sorry i missed the bit about feedback.
for that you could make both apps have a pipe file and they can send and
receive data to each other
So App1 sends "multiply 2x2" to /tmp/App2_pipe
Shell "echo 'multiply 2x2' >/tmp/App2_pipe"

Then app2 send the result to app1
Shell "echo 'MultiplyResult=4' >/tmp/App1_pipe"



On Sat, 24 Apr 2021 at 18:33, Bruce Steers <bsteers4 at gmail.com> wrote:

> You can either use a socket or a pipe file to achieve this.
>
> i made a simple pipe example...
> http://gambaswiki.org/wiki/app/simple-pipe
>
> that application will react to anything echoed to the pipe file. (that
> your other app can do with a Shell "echo 'some command or message'
> >/my/pipe/path")
>
> You should be able to get the idea of what's happening by reading the code.
>
> Or like i say a socket can be used in the same way
>
> BruceS
>
> On Sat, 24 Apr 2021 at 18:29, Ivan Kern <ivan-kern at freenet.de> wrote:
>
>> Hello.
>> I would like some help.
>> I have two gambas apps, for example,
>> app1.gambas and app2.gambas. I start app2 from app1 as a process.
>>
>> myApp2Process = SHELL app2.gambas as "myApp2Process".
>>
>> app2 runs in the background.
>> After that I can receive the feedback with:
>>
>> Public Sub myApp2Process_Read()
>> .....
>> End
>>
>> But what I need is also send the commands to app2 and get appropriate
>> feedback. For example.
>> app2 "multiply 2x2" and get 4 as feedback. Can anyone give me a hint on
>> how to do this in app2. A small example would be nice.
>>
>> Regards
>>
>> Ivan
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210424/688379a4/attachment.htm>


More information about the User mailing list