'05/14/92
' Makes A List Of Callers With Time And Date George M. Cheney 
'loads my personal quick basic library...just in case<grin>
REM $INCLUDE: 'QBGMC.BI'
DEFINT A-Z
REDIM Text(1 TO 1000)
'Routine To Work New Display File If Erased
ON ERROR GOTO NewFiIle
OPEN "CENCALL.DAT" FOR INPUT SHARED AS #2
CLOSE #2

DoItNow:
'Goes To Other Node If SFDOORS.ONE is not Found
ON ERROR GOTO OtherNode 'routine to add multinode support...
OPEN "SFDOORS.ONE" FOR INPUT AS #1
TextLines = 0
DO UNTIL EOF(1)
    LINE INPUT #1, TextRow$
    Handle = 0
    FSSet Handle, TextRow$
    TextLines = TextLines + 1
    Text(TextLines) = Handle
LOOP
'Data From Sfdoors.dat
User$ = FSGet$(Text(2))  ' User Name
Node$ = FSGet$(Text(24))  'Node Number
Calling$ = "Called Node " + Node$
CLOSE #1
'Now Need To Erase The File If It Is There
KILL "SFDOORS.ONE"
GOTO DoItAgain

OtherNode:
RESUME CheckTwo
CheckTwo:
ON ERROR GOTO Finish
OPEN "SFDOORS.TWO" FOR INPUT AS #1
DO UNTIL EOF(1)
    LINE INPUT #1, TextRow$
    Handle = 0
    FSSet Handle, TextRow$
    TextLines = TextLines + 1
    Text(TextLines) = Handle
LOOP
User$ = FSGet$(Text(2))  ' User Name
Node$ = FSGet$(Text(24))  'Node Number
Calling$ = "Called Node " + Node$
CLOSE #1
' Now Need To Erase The File If It Exists..
KILL "SFDOORS.TWO"

DoItAgain:
'Routine To Format To Standard Output 78 Chrs long
'Name First Set At 21 Characters
Name$ = STR$(LEN(User$))
Name1 = VAL(Name$)
Callers = ABS(Name1 - 21)
CallersName$ = User$ + SPACE$(Callers)
'User Name, Node And Time Called Goes Here In Display File
OPEN "CENTIM.DAT" FOR INPUT SHARED AS #2
LINE INPUT #2, When$
CLOSE #2
'String To Put In Cencall.dat
CallPrint$ = CallersName$ + "Called Node " + Node$ + " On " + When$ + " "
'Put It In CENCALL.DAT
OPEN "Cencall.dat" FOR APPEND SHARED AS #3
PRINT #3, CallPrint$
CLOSE #3
'Display routine for local screen
COLOR 15, 0
CLS
OPEN "Cencall.DAT" FOR INPUT SHARED AS #1
DO
    LINE INPUT #1, WhoCalled$
    One$ = STR$(New)
    One = VAL(One$)
    OldNo$ = STR$(1)
    Old = VAL(OldNo$)
    New = ABS(Old + One)
    News = ABS(New - Old)
    PRINT WhoCalled$
    LOOP UNTIL EOF(1)
GOTO Finish

Finish:
CLOSE #1
PRINT "There Has Been " + STR$(News) + " Caller(s) On " + DATE$
SLEEP (5)
RESET
END

NewFiIle:
'Routine To Put Header On Top Of THe File When Erased For New Day
OPEN "Cencall.dat" FOR APPEND SHARED AS #4
PRINT #4, "************************* BBS Callers On " + DATE$ + " *************************"
CLOSE #4
RESUME DoItNow

