[Gambas-user] Shell Wait without Freeze Program

Bruce Steers bsteers4 at gmail.com
Sun May 16 23:19:02 CEST 2021


On Sun, 16 May 2021 at 00:29, Hasan Merkit <hasanmerkit at outlook.com> wrote:

> How i can make waiting Shell without freezes program?
>
>
>
> When i use this:
>
> Shell “bash /etc/teteosnet/temp/piluxupdate_beta1.sh” Wait
>
>
>
> Application executing this SH file, it’s fine but while executing, after
> few seconds OS warn user “My Gambas3 App not responsing. [Wait] [Force
> Quit]”
>
>
>
> Just i want make my program wait to end of script, but not freeze.
>
>
>
>
>
> Example:
>
>
>
> Private Executing As Boolean = False
>
> Public Sub Form_Open()
>
>   Executing = True
>
>    Shell “meow.sh” Wait
>
>    Executing = False
>
> End
>


>
>
> Public Sub Form_Close()
>
>    Stop Event
>
>    If Executing Then
>
>        Message(“Please wait”)
>
>    Else
>
>       Me.Close
>
>    Endif
>
> End
>


AAh sorry now i see.
you do not want to wait for execution to stop you want program to continue
but not quit if process is running.
This makes no sense..

* Executing = True*

* Shell “meow.sh” Wait*

* Executing = False*


because the Shell command freezes program if you use Wait

and if you do not use wait then Executing will be false.
Maybe this is the sort of thing you want to do? .....

'''''''''''''''''''''''''''
Private myProc As Process

>
Public Sub Form_Open()
  myProc = Shell “meow.sh”
End


Public Sub Form_Close()
   If myProc.State = Process.Running Then

       Message(“Please wait”)

      Stop Event

      Return
   Endif


If myProc then myProc.Kill

End
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210516/0ace67cb/attachment-0001.htm>


More information about the User mailing list