home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
213a.lha
/
LogRexx
/
logoff.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-02-14
|
2KB
|
49 lines
/* ARexx logoff program */
cuFILE='T:CurrentUser'
if open('cu',cuFILE)
then
do
CurrentUser=readln('cu')
etFILE='T:et'||CurrentUser
atFILE='log:at'||CurrentUser
logFILE='log:log'||CurrentUser
if open('etime',etFILE,'r')
then
do
et=(time('e')-readln('etime'))/60
outline = "Elapsed Time = "||et||" Minutes"
say CurrentUser||" logged off"
say outline
if open('mylog',logFILE,'A')
then
do
dummy=writeln('mylog',CurrentUser||" logged off")
dummy=writeln('mylog',outline)
if open('atime',atFILE,'r')
then
do
at=readln('atime')
if at=''
then at=et
else at=at+et
outline = "Total Accumulated Time = "||at||" minutes"
say outline||'0A'x
dummy=close('atime')
dummy=open('atime',atFILE,'w')
dummy=writeln('atime',at)
dummy=writeln('mylog',outline||'0A'x)
end
else
do
if open('atime',atFILE,'w')
then dummy=writeln('atime',et)
else say "failed to open "||atFILE
end
end
else say "failed to open "||logFILE
dummy=close('cu')
'delete T:CurrentUser'
end
else say "oops! Better logon again"
end
else say "No CurrentUser file found; You must logon first"