newtofoxpro
Programmer
Code not tested. This is my idea, Pls post yours.
Code:
ApplicationType="SingleUser"
IF !FILE("users.dbf")
CREATE TABLE users.dbf (CompName c(20), UserName c(20))
USE
ENDIF
USE users.dbf IN 0 ALIAS "users"
ON ERROR WAIT WINDOW NOWAIT ""
SET REPROCESS TO 1
DELETE FOR LOCK() IN users
INSERT INTO users VALUES (UPPER(GETENV("COMPUTERNAME")),UPPER(GETENV("USERNAME")))
=LOCK("users")
SELECT * FROM users INTO ARRAY JustCheck GROUP BY CompName,UserName
IF _tally>1 AND ApplicationType="S"
WAIT WINDOW "Single user application"
QUIT
ENDIF