Am 14.03.2012 10:39, schrieb abbat:
> Dim sOutput As String
>>
>> Exec ["pgrep", "-f", "-l", "NameOfYourProgram.gambas"] Wait To sOutput
>>
>> If Split(Trim$(sOutput), gb.NewLine).Count> 1 Then
>> Quit
>> Endif
I just tested it and inserted it into some of my projects (Gambas2). I
Hi Jussi
You solution works and is wery usefull
Thank you very much
:-)
Jussi Lahtinen wrote:
>
> This is code that I use:
>
> Dim sOutput As String
>
> Exec ["pgrep", "-f", "-l", "NameOfYourProgram.gambas"] Wait To sOutput
>
> If Split(Trim$(sOutput), gb.NewLine).Count > 1 Then
> Qu
; the PID number in the string returned by "pgrep" (Jussi's
solution: very good) or "grep" (my...long solution).
Bye
Vuott
--- Mar 13/3/12, Jussi Lahtinen ha scritto:
> Da: Jussi Lahtinen
> Oggetto: Re: [Gambas-user] R: Prog.gambas only one process
> A
This is code that I use:
Dim sOutput As String
Exec ["pgrep", "-f", "-l", "NameOfYourProgram.gambas"] Wait To sOutput
If Split(Trim$(sOutput), gb.NewLine).Count > 1 Then
Quit
Endif
Jussi
On Tue, Mar 13, 2012 at 03:29, Ru Vuott wrote:
> My suggestion:
>
> <<
>
> Public Sub Form
e) from that
you created the executive
and see in console if a (between many) string-variable plura[b] has then PID
number of executive.
--- Mar 13/3/12, abbat ha scritto:
> Da: abbat
> Oggetto: Re: [Gambas-user] R: Prog.gambas only one process - RECTIUS !!!
> A: gambas-user@li
Does not work.
I guess because programm.gambas is not shown ib process list so we can not
find what to "kill"
Vuott wrote:
>
> Excuse me, a little problem at name of program (before it was strange
> "aaa"):
> I re-send the code:
>
> <
>
> Public Sub Form_Open()
>
> Dim inde
Excuse me, a little problem at name of program (before it was strange
"aaa"):
I re-send the code:
<
Public Sub Form_Open()
Dim index As String
Dim plura As String[]
Dim a, b, c As Integer
Shell "ps -aux | grep " & "my_gambas__program" To index
plura = Split(index, "
My suggestion:
<<
Public Sub Form_Open()
Dim index As String
Dim plura As String[]
Dim a, b, c As Integer
Shell "ps -aux | grep " & "" To index
plura = Split(index, " ")
c = plura.Count
For a = 0 To c - 1
If Right(plura[a], 20) Like "*.gambas*" Then