You call it with a GOSUB LogFile, edit $file to point where you want the log file to be.
code:
;****************************************************
:logfile ;v1.62 by Bryce Lindsay
;****************************************************
; write a log file of when people logon to the systemdim $file ;set temp $file variable
dim $linetowrite ;set test $linetowrite variable
dim $ip
dim $a
dim $b
dim $c
dim $d
dim $abcd
$file = "\\houston\syswr\log\logon.log"
$IP = @ipaddress0 ; #ip#
$a = LTRIM(SUBSTR(@IPADDRESS0, 1, 3)) ; #ip#
$b = LTRIM(SUBSTR(@IPADDRESS0, 5, 3)) ; #ip# Get the IP# and assign it to $ipadr
$c = LTRIM(SUBSTR(@IPADDRESS0, 9, 3)) ; #ip#
$d = LTRIM(SUBSTR(@IPADDRESS0, 13, 3)) ; #ip#
$IPADR = "$a.$b.$c.$d" ; #ip#
$linetowrite = "@fullname, @userid, @wksta/$abcd, @monthno/@mdayno/@year, @time"
:logfile2
if open(10, $file, 4) = 0
$q = writeline(10, $linetowrite + chr(13) + chr(10))
$q = close (10)
else
if open (10,$file,1) = 0
$q = close (10)
$q = open(10, $file, 4)
$q = writeline(10, "KIX Log file 1.5" + chr(13) + chr(10))
$q = writeline(10, "By bryce.lindsay@@oshmans.com" + chr(13) + chr(10))
$q = writeline(10, "===============================================" + chr(13) + chr(10))
$q = writeline(10, "Full Name, UserID, computername/IP#, Date, Time" + chr(13) + chr(10))
$q = close (10)
goto logfile2
else
? "Log File could Not be created."
endif
endif
return