how to check program already running?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

how to check program already running?

Post by MaxV » Mon May 24, 2021 7:56 pm

Hello,
I created an access control time and attendance for my company using livecode.
It automatically starts when the user login successfully.
I want to add to the program a check that verify if it is already launched. So he use can't run more than an instance of the program.
just to give yo the whole picture:
  • windows server
  • user login in and so he automatically starts my "check Presence" program. The program will run until the user is working.
  • at startup it should check program should check if it's already started, in this case "quit". How to do it?
I would not rely on external files (for example at startup write a file "running"), because in case of failures the file would remain there and the program will never start again.

Do you have any suggestion?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: how to check program already running?

Post by bogs » Mon May 24, 2021 8:07 pm

Heya Max, long time no see :)
I created an access control time and attendance for my company using livecode.
If your starting the program using a livecode program, perhaps "open process" and "openProcesses" is what your looking for?
Image

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: how to check program already running?

Post by SparkOut » Mon May 24, 2021 8:21 pm

Actually you should handle (or not, if desired) the "relaunch" message to control what happens when someone instigates another opening of the same stack.

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: how to check program already running?

Post by stam » Sat May 29, 2021 7:59 am

SparkOut wrote:
Mon May 24, 2021 8:21 pm
Actually you should handle (or not, if desired) the "relaunch" message to control what happens when someone instigates another opening of the same stack.
+1 !

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”