[Gambas-user] Avoiding multiple instances

Stefano Palmeri rospolosco at ...152...
Fri Feb 1 15:20:40 CET 2008


And so finally :-) , to avoid multiple instances we could do:

PUBLIC SUB Main()

  DIM sShellOutput AS String
     
  SHELL "pgrep -f " & Application.Args[0] TO sShellOutput
  IF Split(Trim$(sShellOutput), "\n").Count > 1 THEN QUIT 
             
END

Stefano




 




More information about the User mailing list