* Was the user logged in OK, if so then we will start the timer that will update * the log file every 10 minutes with their datetime IF lllog_flag * Before we add our timer we need to save what current class library is set * just in case LOCAL lcSaveClassLib lcSaveClassLib = SET('CLASSLIB') SET CLASSLIB TO "c40Utilities" * Lets add our timer to the active screen form _screen.addobject("oUpdateLogUserTimer","c40UpdateLogUserTimer",m_procid,m_userid) * Reset our library SET CLASSLIB TO &lcSaveClassLib ENDIFThe code that fires off in the timer every 10 minutes is:
IF USED("log_user") SELECT log_user SET ORDER TO TAG "proc_id" ELSE SELECT 0 USE log_user.DBF AGAIN ALIAS log_user ORDER TAG "proc_id" ENDIF * First lets get a synq date time from the novell sever * as the users computer may have there clock off lcMyServerFile = oData.Code40SysDir+"\TEMP\"+SUBSTR(sys(2015),3,8)+'.CLK' handle=fcreate(lcMyServerFile) =fclose(handle) lcDate = fdate(lcMyServerFile) lcTime = ftime(lcMyServerFile) erase (lcMyServerFile) SELECT log_user LOCATE * * Locate for the user's record with the properties of this class that were set up in the * init of the class LOCATE FOR (log_user.user_id = THIS.cUserId AND log_user.proc_id = THIS.cProcessID) AND NOT DELETED() * IF NOT EOF() * We will use the time from the server REPLACE log_user.activetime WITH CTOT(DTOC(lcDate)+' '+lcTime) lllog_flag = .T. ELSE * We have not decieded what to do here yet, if the users record is not found lllog_flag = .T. ENDIF