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

Rolf-Werner Eilert eilert-sprachen at ...221...
Wed Mar 14 12:18:56 CET 2012


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





More information about the User mailing list