Re: [Gambas-user] R: Prog.gambas only one process
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 Quit Endif Jussi On Tue, Mar 13, 2012 at 03:29, Ru Vuott vu...@yahoo.it wrote: 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 For b = a To 100 Try Shell kill plura[b] Next Endif Next End bye Vuott --- Mar 13/3/12, abbat abbat...@mail.ru ha scritto: Da: abbat abbat...@mail.ru Oggetto: [Gambas-user] Prog.gambas only one process A: gambas-user@lists.sourceforge.net Data: Martedì 13 marzo 2012, 00:44 How to allow to run only one copy of prog.gambas? I tried to: Shell [killall, prog.gambas] on form open... But there is no such a process when prog.gambas is running/ -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33491262.html Sent from the gambas-user mailing list archive at Nabble.com. -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33500556.html Sent from the gambas-user mailing list archive at Nabble.com. -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] R: Prog.gambas only one process
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). It runs flawlessly, however when used in a multi-user environment where more than one user could use it, you should add -u username to the string: Exec [pgrep, -f, -l, -u, System.User.Name, NameOfYourProgram.gambas] Wait To sOutput This way, it really runs well here! Rolf -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] R: Prog.gambas only one process - RECTIUS !!!
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 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, ) c = plura.Count For a = 0 To c - 1 If Right(plura[a], 20) Like *.gambas* Then For b = a To 100 Try Shell kill plura[b] Next Endif Next End --- Mar 13/3/12, abbat abbat...@mail.ru ha scritto: Da: abbat abbat...@mail.ru Oggetto: [Gambas-user] Prog.gambas only one process A: gambas-user@lists.sourceforge.net Data: Martedì 13 marzo 2012, 00:44 How to allow to run only one copy of prog.gambas? I tried to: Shell [killall, prog.gambas] on form open... But there is no such a process when prog.gambas is running/ -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33491262.html Sent from the gambas-user mailing list archive at Nabble.com. -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33492643.html Sent from the gambas-user mailing list archive at Nabble.com. -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] R: Prog.gambas only one process - RECTIUS !!!
I tried my prototype, and it run ! If I try to run two times the same program... the second doesen't start !!! :-) It founded on: ps -aux | grep my_gambas__program In fact, i f you run that line in your Terminal, you can see the PID of my_gambas_program. Uhmm... 1) Change this line: Try Shell kill plura[b] With: Print plura[b] 2) Create an executive. Then you have run this executive. 3) Then run in Terminal: ps -aux | grep my_gambas_executive and see PID of executive. 4) Then run the program (now I mean the project, not the executive) 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 abbat...@mail.ru ha scritto: Da: abbat abbat...@mail.ru Oggetto: Re: [Gambas-user] R: Prog.gambas only one process - RECTIUS !!! A: gambas-user@lists.sourceforge.net Data: Martedì 13 marzo 2012, 09:11 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 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, ) c = plura.Count For a = 0 To c - 1 If Right(plura[a], 20) Like *.gambas* Then For b = a To 100 Try Shell kill plura[b] Next Endif Next End --- Mar 13/3/12, abbat abbat...@mail.ru ha scritto: Da: abbat abbat...@mail.ru Oggetto: [Gambas-user] Prog.gambas only one process A: gambas-user@lists.sourceforge.net Data: Martedì 13 marzo 2012, 00:44 How to allow to run only one copy of prog.gambas? I tried to: Shell [killall, prog.gambas] on form open... But there is no such a process when prog.gambas is running/ -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33491262.html Sent from the gambas-user mailing list archive at Nabble.com. -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33492643.html Sent from the gambas-user mailing list archive at Nabble.com. -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] R: Prog.gambas only one process
Hello Jussi, wery well, yes I tried it and it works fine ! Mine works too, but yours it's shorter and more simple than mine ! I didn't know pgrep... thank you ! Optime ! I want to say to abbat.81 that the operation principle is substantially the same: picking 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 jussi.lahti...@gmail.com ha scritto: Da: Jussi Lahtinen jussi.lahti...@gmail.com Oggetto: Re: [Gambas-user] R: Prog.gambas only one process A: mailing list for gambas users gambas-user@lists.sourceforge.net Data: Martedì 13 marzo 2012, 21:33 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 vu...@yahoo.it wrote: 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 For b = a To 100 Try Shell kill plura[b] Next Endif Next End bye Vuott --- Mar 13/3/12, abbat abbat...@mail.ru ha scritto: Da: abbat abbat...@mail.ru Oggetto: [Gambas-user] Prog.gambas only one process A: gambas-user@lists.sourceforge.net Data: Martedì 13 marzo 2012, 00:44 How to allow to run only one copy of prog.gambas? I tried to: Shell [killall, prog.gambas] on form open... But there is no such a process when prog.gambas is running/ -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33491262.html Sent from the gambas-user mailing list archive at Nabble.com. -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] R: Prog.gambas only one process
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 For b = a To 100 Try Shell kill plura[b] Next Endif Next End bye Vuott --- Mar 13/3/12, abbat abbat...@mail.ru ha scritto: Da: abbat abbat...@mail.ru Oggetto: [Gambas-user] Prog.gambas only one process A: gambas-user@lists.sourceforge.net Data: Martedì 13 marzo 2012, 00:44 How to allow to run only one copy of prog.gambas? I tried to: Shell [killall, prog.gambas] on form open... But there is no such a process when prog.gambas is running/ -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33491262.html Sent from the gambas-user mailing list archive at Nabble.com. -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] R: Prog.gambas only one process - RECTIUS !!!
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, ) c = plura.Count For a = 0 To c - 1 If Right(plura[a], 20) Like *.gambas* Then For b = a To 100 Try Shell kill plura[b] Next Endif Next End --- Mar 13/3/12, abbat abbat...@mail.ru ha scritto: Da: abbat abbat...@mail.ru Oggetto: [Gambas-user] Prog.gambas only one process A: gambas-user@lists.sourceforge.net Data: Martedì 13 marzo 2012, 00:44 How to allow to run only one copy of prog.gambas? I tried to: Shell [killall, prog.gambas] on form open... But there is no such a process when prog.gambas is running/ -- View this message in context: http://old.nabble.com/Prog.gambas-only-one-process-tp33491262p33491262.html Sent from the gambas-user mailing list archive at Nabble.com. -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user