Re: [Gambas-user] R: Prog.gambas only one process

2012-03-14 Thread Rolf-Werner Eilert
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

Re: [Gambas-user] R: Prog.gambas only one process

2012-03-14 Thread abbat
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

Re: [Gambas-user] R: Prog.gambas only one process

2012-03-13 Thread Ru Vuott
; 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

Re: [Gambas-user] R: Prog.gambas only one process

2012-03-13 Thread Jussi Lahtinen
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

Re: [Gambas-user] R: Prog.gambas only one process - RECTIUS !!!

2012-03-13 Thread Ru Vuott
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

Re: [Gambas-user] R: Prog.gambas only one process - RECTIUS !!!

2012-03-13 Thread abbat
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

[Gambas-user] R: Prog.gambas only one process - RECTIUS !!!

2012-03-12 Thread Ru Vuott
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, "

[Gambas-user] R: Prog.gambas only one process

2012-03-12 Thread Ru Vuott
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