General information
Category:
Coding, syntax & commands
I've used a technique where each user who opens the program get his own resource file. IE: set resource to rr+"userid"
I loop through all resource files and see if I can open all the users resource files through low level file functions. If I can't, then someone is definitely logged on.
I suppose you could use this technique to open all tables...
Cheerio
*********************
use users
GO TOP
SCAN
l_resfilename='RR'+ALLTRIM(userid)+'.dbf'
WAIT WINDOW "Checking if "+ALLTR(users.name)+" is online" NOWAIT
IF FILE(l_resfilename) AND users.userid # _cuserid && check resource file
l_lockresfile=FOPEN(l_resfilename)&& try to open using low level function
IF l_lockresfile>=0 && if sucessful...
=FCLOSE(l_lockresfile) && close it
IF logged='Y'
WAIT WINDOW "Clearing logged flag" NOWAIT REPLACE logged WITH ' '
ENDIF
ENDIF
ENDIF
ENDSCAN
RETURN
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