* PROGRAM NLM_TEST * Test for the workstation TSR and the correct file handle * Put this program in a logon verb. * Use NLM_TEST ON to enable the full trap. * 08/14/96 - BTS - Original release of program * 11/11/97 - BTS - Revise DOS file name logic for the error log Declare Subroutine Msg Declare Function ISTSR EQUATE FileName$ to "VOC" EQUATE CRLF$ TO CHAR(13):CHAR(10) ******************** * Begin Executable * ******************** OPTION = FIELD(@SENTENCE," ",2) IF ISTSR() THEN NULL ELSE ERROR_TEXT = "[No TSR]" GOSUB UPDATE_LOG: MsgTxt = "|The AREV NLM Workstation TSR is not loaded.|" IF OPTION = "ON" THEN MsgTxt := "You will now be logged off.|" Msg( MsgTxt, '','','' ) LogOff END ELSE MsgTxt := "Please notify your system administrator.|" Msg( MsgTxt, '','','' ) END END IF OPTION = "ON" THEN Open FIleName$ to FHandle then IF INDEX(FHandle,"FFFFFF",1) else ERROR_TEXT = "[Bad handle]" GOSUB UPDATE_LOG: MsgTxt = "!!!Warning!!!||" MsgTxt := "The %1% file is NOT under NLM control.|" MsgTxt := "Please contact your SYSTEM ADMINISTRATOR imediately!|" MsgTxt := "You will now be logged off.|" Msg( MsgTxt, "", "", FileName$ ) LogOff end end else ERROR_TEXT = "[Missing ":FileName$:"]" GOSUB UPDATE_LOG: MsgTxt = "!!!Warning!!!||" MsgTxt := "The %1% file is not currently available for the NLM control test.||" MsgTxt := "Please contact your SYSTEM ADMINISTRATOR imediately!|" MsgTxt := "You will now be logged off.|" Msg( MsgTxt, "", "", FileName$ ) LogOff end END STOP ************************ * Internal Subroutines * ************************ UPDATE_LOG: STATION = FIELD(@STATION,"*",2) IF STATION THEN DOS_FILE = STATION[1,8]:".LOG" END ELSE DOS_FILE = "arevuser.log" END DOS_DATA = '' OSREAD DOS_DATA FROM DOS_FILE THEN IF DOS_DATA THEN DOS_DATA:= CRLF$ END ELSE NULL DOS_DATA:= DATE()"D2/":" ":TIME()"MTH":" ":ERROR_TEXT:" ":@ACCOUNT:" ":@USERNAME:" ":@STATION OSWRITE DOS_DATA ON DOS_FILE RETURN END