Stacy,
It's actually alot more simple. The code sample below can tell if the user is logged in the system already. Using file handles automatically assures that if the users system abends, the file handle is released. It also works with all client systems since it is file system based.
* Begin
cFileName = "system\" + alltrim(gcUserName) + ".txt"
if not file(cFileName)
ThisForm.UserHandle = fcreate(cFileName, 0)
else
ThisForm.UserHandle = fopen(cFileName, 12) && Open Exclusive
if ThisForm.UserHandle <= 0
=MessageBox("User is current logged into system.")
endif
endif
* End
You can also easily modify the code to put an ADIR and count the file
locks to determine the number of users in the system, for a license count
perhaps.
HTH,Ed
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only