[Gambas-user] Avoiding multiple instances

Jeffrey Cobb maillists.gurulounge at ...626...
Fri Feb 1 02:38:37 CET 2008


All these ideas give me...an idea.

Is there a way to find out the PID of the gambas program that is
running?

Thanx again!
Jeff
On Thu, 2008-01-31 at 18:38 +0100, Epíleg wrote:
> En/na Stefano Palmeri ha escrit:
> > Alle 16:45, giovedì 31 gennaio 2008, Stefano Palmeri ha scritto:
> >> I use this simple code:
> >>
> >> PUBLIC SUB Main()
> >>  
> >>   DIM sShellOutput AS String
> >>  
> >>   SHELL "ps aux | grep " & Application.Name & ".gambas" & " | grep -v grep"
> >> TO sShellOutput
> >>  
> >>   IF sShellOutput THEN QUIT  
> >>      
> >> END
> > 
> > or better:
> > 
> > PUBLIC SUB Main()
> >   
> >   DIM sShellOutput AS String
> >   
> >   SHELL "ps aux | grep " & Application.Name & ".gambas" & 
> >         " | grep -wv grep | wc -l" TO sShellOutput 
> >   
> >   IF Val(sShellOutput) > 1 THEN QUIT  
> >           
> > END
> 
> Very good solution. Thanks a lot!
> 
> Epíleg.
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list