rem logoff.bas (formerly LOGOUT.BAS) %nolist def fnsup external integer fnsup fend def fncons external rem return console # integer fncons fend def fnet(x$) external integer fnet fend call fnsup def pdat$(x$)=mid$(x$,3,2)+"/"+right$(x$,2)+"/"+left$(x$,2) def ptim$(x$)=left$(x$,2)+":"+mid$(x$,3,2)+":"+right$(x$,2) on error goto barf print "[RTDS (c) 1984 ESKAY]" print "[LOGOFF v2.30 - console ";str$(fncons);"]" print pdat$(date$);" - ";ptim$(time$) print def fncbbs external rem chain to CBBS integer fncbbs fend def fnhalt external integer fnhalt fend def fnstat(x$) external integer fnstat fend nad$=right$("000"+str$(fncons),3) lcalr$="LASTCALR."+nad$ open lcalr$ as 1 readonly read #1; fn$,ln$,dt$,tm$,ac$ close 1 if len(command$) > 5 then\ lprinter : print "FROM ";fn$;" ";ln$;": ";command$ :\ console rem rem un-REM the following stuff for CBBS rem rem if end #1 then nos rem open "SUMMARY" as 1 unlocked rem if end #1 then ends rem pt%=0 rem cksum: read #1; n$,l$,d$,f$,t$,s$,p$ rem if t$<>fn$+" "+ln$ then goto cksum rem if l$>"99" then goto cksum rem deleted msg rem if pt%=0 then print "Message(s) waiting in CBBS:" : pt%=1 rem print n$;" from ";f$;" subj: ";s$ rem goto cksum rem rem the following code scans the PERSONAL.MSG file of RBBS4 rem if end #1 then nos open "PERSONAL.MSG" recl 64 as 1 readonly if end #1 then ends cn$=fn$+" "+ln$ : cnl%=len(cn$) : pt%=0 cksum: read #1; line l$ rem get a line slines=val(mid$(l$,6,2)) rem get number of lines if slines/2<>int(slines/2) then slines=slines+1 rem make even number if mid$(l$,9,1)="0" then slines=slines+1 : goto cklsl rem skip killed read #1; line l$ rem get TO line if mid$(l$,2,cnl%) = cn$ then pt%=1 : goto ends cklsl: read #1; line l$ rem skip to next msg slines=slines-1 if slines=0 then goto cksum else goto cklsl nos: lprinter : print "HEY DUMMY, SET PERSONAL.MSG;G!" : console goto nos1 ends: close 1 nos1: if pt%=0 then goto exit print try.agn: print print "You have personal mail in RBBS." input "Do you wish to log off anyway ? "; line yn$ if left$((ucase$(yn$)+"N"),1)="N" then\ print : print "Chaining to RBBS...":\ print : call fncbbs if left$((ucase$(yn$)+"N"),1)<>"Y" then goto try.agn goto exit barf: print : print print "Awfully sorry, but an error occurred." print "I'll have to drop you..." print "code : ";err;"/";errl lprinter print "err ";err;" in line ";errl;" at ";pdat$(date$);"|";ptim$(time$); print " in LOGOFF" console exit: et$=ptim$(time$) xx$=ptim$(tm$)+et$ xx$=left$(xx$,16) print "Time on system was "; : call fnet(xx$) print "Good bye, please call again soon!" : print : print for i=1 to 500 : next i call fnhalt end