home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
BBS_UTIL
/
BM0406_A.ZIP
/
0406.ZIP
/
RBBSSUB7.NEW
< prev
next >
Wrap
Text File
|
1994-04-06
|
130KB
|
2,852 lines
' $linesize:132
' $title: 'RBBSSUB7.BAS 17.5, Copyright 1986 - 94 by D. Thomas Mack'
' Copyright 1991 by D. Thomas Mack, all rights reserved.
' Name ...............: RBBSSUB7.BAS
' First Released .....: November 15, 1993
' Subsequent Releases.:
' Copyright ..........: 1986 - 1994
' Purpose.............: The Remote Bulletin Board System for the IBM PC,
' RBBS-PC.BAS utilizes a lot of common subroutines. Those that do not
' require error trapping are incorporated within RBBSSUB 2-7 as
' separately callable subroutines in order to free up as much
' code as possible within the 64K code segment used by RBBS-PC.BAS.
' Parameters..........: Most parameters are passed via a COMMON statement.
'
' Subroutine Line Function of Subroutine
' Name Number
' AddLink 63620 Adds a conference link
' ANSIChat 1000 Vertical Split Screen SysOp ANSI Chat Routine
' AraAllCaps 63720 Capitalize an elment of an array
' AskItems 63610 Get an list of items
' BadName 20235 Check for system crash attempt with bad file name
' BinSearch 63520 Binary searches sorted file for a key value
' BufAsUnit 63440 Buffer out a string with CR's
' ChangeInt 63590 Get an integer value ' KG01802
' CheckRatio 20096 Test upload/download ratio
' ChkIfMsgHeader 63550 Checks whether record is a msg header
' ChkMsgName 63540 Match Name to one in message file
' ClearScrn 7000 Clears screen using ANSI ' RM03049401
'ClearLocalLower 7400 Clears SysOp side lower half of split screen chat ' RM03049401
'ClearLocalUpper 7200 Clears SysOp side upper half of split screen chat ' RM03049401
'ClearRemoteLower 7300 Clears user side lower half of split screen chat ' RM03049401
'ClearRemoteUpper 7100 Clears user side upper half of split screen chat ' RM03049401
'CmdStackPushPop 63500 Save/Restore command stack
' CurLocate 7500 Moves cursor using ANSI codes ' RM03049401
' Decorate 2000 Sets up screen for SysOp Split Screen Chat ' RM03049401
' DeLink 63620 Removes conference from linked ones
' DispUserRec 63580 Displays user record
' DoorExit 10983 Set up a .BAT file to exit RBBS-PC to a "door"
' DoorInfo 10991 Writes out information for a door
' DosExit 10935 Set up a .BAT file to exit to DOS (second level)
' ExcludeCount 63715 Counts # of words in a string
' FileNameCheck 20240 Matches file name to a prefix & extension
' FindIt 63490 Check whether file exists and if so open as #2
' FormRead 63420 Read from file into a form
' GetArc 20140 Handle request for verbose listing
' GetFastFile 63750 Sets the Fast File Tabs List' ' RM03269401
'LocalScreenWrite 4000 Writes to SysOp side of split screen chat ' RM03049401
' LockAppend 63400 Prepare for a file append
' LogError 13660 Log error message to CALLERS file
' MacroExe 63460 Execute internal macro rather than user
' MarkItems 63600 Convert list of items into a "mark"
' MsgNameMatch 63540 Match name to one in msg header
' NextConf 63615 Sets up join to next conference link
' NoPath 63480 Detects whether string has a path in it
' PauseExit 63465 Forces a keyboard pause inside a Macro
' PersonalRing 20350 Detects "Distinctive Ring" patterns from Phone Co. 'JR070101
' QuickPeek 20340 Easy find user to send message to ' PEEK174
' RBBSExit 10992 RBBS-PC exit to transfer control to other programs
' ReadParms 63490 Read certain number of parameters from file 2
' ReadXfer 85000 subroutine to read the XFER-?.DEF File ' DGS090601-DS
' RecoverMsg 10410 Recover a deleted message
'RemoteScreenWrite 3000 Writes to user side of split screen chat ' RM03049401
' ReportEcho 63635 Reports echo preference of caller
' ResetRegDate 63585 Checks proposed new registration date
' SayWelcome 63640 Welcomes callers on logon
' SelectCD 63800 Select Which CD to display ' RM03239401
' SetBPS 20245
' SetGlobalUpDn 63675 Sets Global user stats
' SetPrivileges 63650 Sets user privileges based on PASSWRDS
' SetPrompt 63470 Set prompts based on the user's security
' SetSection 12000 Set the proper section prompts (main, file, util, libr)
' SetSessionTime 63645 Sets the session time
' SetSysOp 63625 Determines whether remote or global SysOp
' SetUserFlag 63560 Sets specified user flag
' SetUserPref 63630 Sets user preferences based on user record
' SetUserUpDn 63675 Sets user's upload/download/bank time stats
' ShellExit 63320 Exit RBBS via shell
' SrchPasswrds 63652 Searches the PASSWRDS file
' SysOpVChat 5000 Split Screen Chat ' RM03049401
' TakeOffHook 63530 Take modem off hook
' TestANSI 63700 Tests caller for ANSI compatibility
' TimeBack 63495 Give time back to user
' UnLockAppend 63410 Clean up after file append
' UnMarkItems 63610 Convert marked items into an input list
' UntilRight 12878 Ask a question until user says answer is right
' UpdateU 10600 Updates the user record on loging off/exiting RBBS-PC
' VerifyAns 63510 Verify that string passes edits
' WildCard 63200 Match string to a pattern
' WordInFile 10976 Find a whole word within a file/menu
'
' $INCLUDE: 'RBBS-VAR.BAS'
'
' $SUBTITLE: 'ANSIChat - Vertical Split Screen SysOp ANSI Chat Routine'
'
' $PAGE
'
' ANSIChat Vertical Split Screen Chat for RBBS-PC v17.4x'
'
' (c) 1991,1992,1993 By Richie Molinelli
'
'
' SUBROUTINE NAME - ANSIChat
'
' INPUT - None
'
' OUTPUT - None
'
' PURPOSE -- Allows Vertical Split Screen ANSI SysOp Chat for RBBS
'
'
1000 SUB ANSIChat ' Main program ' RM03299401
CALL ClearScrn
CALL Decorate
CALL SysopVChat
IF ZSubParm < 0 THEN _ ' RM12189303
EXIT SUB ' RM12189303
CALL ClearScrn
CALL SkipLine (1)
END SUB
'
2000 SUB Decorate ' Sets up the screen for chat ' RM03299401
ScreenTxt$ = STRING$(78,177)
CALL CurLocate (1,1)
CALL QuickTPut (ZFG6$ + ScreenTxt$,0)
CALL CurLocate (24,1)
CALL QuickTput (ScreenTxt$,0)
CALL CurLocate (1,1)
CALL QuickTPut (ZEmphasizeOn$ + "ANSIChat v1.5ß",0) ' RM10109301/RM03049401
OutTxt$ = " >>> " + ZRBBSName$ + " <<< " ' RM100101
LocalColumn = 40 - (LEN(OutTxt$)/2) ' RM100101
CALL CurLocate (1,LocalColumn)
CALL QuickTPut (OutTxt$,0) ' RM100101
CALL CurLocate (1,60)
CALL QuickTPut ("(c) 1992 R Molinelli",0)
Column = 40
CALL QuickTPut (ZFG5$,0)
FOR Row = 2 TO 23
CALL CurLocate (Row,Column) : _
CALL QuickTPut(STRING$(1,186),0) : _
NEXT Row
OutTxt$ = ZSysopFirstName$ + " " + ZSysopLastName$ ' RM100101
LocalColumn = (40 - LEN(OutTxt$))/2 ' RM100101
CALL CurLocate (24,LocalColumn)
CALL QuickTPut (ZEmphasizeOn$ + OutTxt$,0) ' RM100101
LocalColumn = 40 + ((40 - LEN(ZActiveUserName$))/2)
CALL CurLocate (24,LocalColumn)
CALL QuickTPut (ZActiveUserName$ + ZEmphasizeOff$,0)
CALL Line25
CALL CurLocate (2,1)
END SUB
'
3000 SUB RemoteScreenWrite (RemoteTxt$,RemoteRow,RemoteColumn,Bs) STATIC ' Writes Remote Users Input
BackSpace = ZFalse ' RM10109302
IF HoldRTxt$ <> "" AND Bs = 1 THEN _
HoldRTxt$ = MID$(HoldRTxt$,1,LEN(HoldRTxt$) - 1)
IF Bs = 1 THEN _
RemoteColumn = RemoteColumn - 1 : _
RemoteTxt$ = " " : _
BackSpace = ZTrue : _ ' RM10109302
GOSUB 3010 : _
Bs = 0 : _
GOTO 3020
IF LEN(HoldRTxt$) => 38 THEN
HoldRTxt$ = ""
RemoteColumn = 42
RemoteRow = RemoteRow + 1
IF RemoteRow > 23 THEN _
CALL ClearRemoteUpper : _
RemoteRow = 2
CALL CurLocate (RemoteRow,RemoteColumn)
END IF
IF RemoteTxt$ <> " " THEN _
HoldRTxt$ = HoldRTxt$ + RemoteTxt$ _
ELSE _
HoldRTxt$ = ""
IF RemoteColumn > 78 AND RemoteTxt$ = " " THEN
RemoteColumn = 42
RemoteRow = RemoteRow + 1
IF RemoteRow = 12 THEN _
CALL ClearRemoteLower
IF RemoteRow > 23 THEN _
CALL ClearRemoteUpper : _
RemoteRow = 2
CALL CurLocate (RemoteRow,RemoteColumn)
RemoteTxt$ = ""
HoldRTxt$ = ""
EXIT SUB
END IF
IF RemoteColumn > 79 AND RemoteTxt$ <> " " THEN
RemoteColumn = 80 - LEN(HoldRTxt$)
HoldCTxt$ = STRING$((LEN(HoldRTxt$) + 1),32)
CALL CurLocate (RemoteRow,RemoteColumn)
CALL QuickTPut (HoldCTxt$,0)
RemoteColumn = 42
RemoteRow = RemoteRow + 1
IF RemoteRow = 12 THEN _
CALL ClearRemoteLower
IF RemoteRow > 23 THEN _
CALL ClearRemoteUpper : _
RemoteRow = 2
CALL CurLocate (RemoteRow,RemoteColumn)
CALL QuickTPut (ZFG2$ + HoldRTxt$,0)
RemoteColumn = RemoteColumn + LEN(HoldRTxt$)
CALL CurLocate (RemoteRow,RemoteColumn)
ZRemoteTxt$ = ""
EXIT SUB
END IF
3010 CALL CurLocate (RemoteRow,RemoteColumn)
IF BackSpace THEN _ ' RM10109302
CALL QuickTPut (RemoteTxt$,0) _ ' RM10109302
ELSE _ ' RM10109302
CALL QuickTPut (ZFG2$ + RemoteTxt$,0)
IF Bs > 0 THEN _
CALL CurLocate (RemoteRow,RemoteColumn) : _
RETURN
RemoteColumn = RemoteColumn + LEN(RemoteTxt$)
3020 RemoteTxt$ = ""
END SUB
'
4000 SUB LocalScreenWrite (LocalTxt$,LocalRow,LocalColumn,Bs) STATIC ' Writes Local Users Input
BackSpace = ZFalse ' RM10109302
IF HoldLTxt$ <> "" AND Bs = 1 THEN _
HoldLTxt$ = MID$(HoldLTxt$,1,LEN(HoldLTxt$) - 1)
IF Bs = 1 THEN _
LocalColumn = LocalColumn - 1 : _
BackSpace = ZTrue : _ ' RM10109302
LocalTxt$ = " " : _
GOSUB 4010 : _
Bs = 0 : _
GOTO 4020
IF LEN(HoldLTxt$) => 38 THEN
HoldLTxt$ = ""
LocalColumn = 1
LocalRow = LocalRow + 1
IF LocalRow > 23 THEN _
CALL ClearLocalUpper : _
LocalRow = 2
CALL CurLocate (LocalRow,LocalColumn)
END IF
IF LocalTxt$ <> " " THEN _
HoldLTxt$ = HoldLTxt$ + LocalTxt$ _
ELSE _
HoldLTxt$ = ""
IF LocalColumn > 37 AND LocalTxt$ = " " THEN
LocalColumn = 1
LocalRow = LocalRow + 1
IF LocalRow = 12 THEN _
CALL ClearLocalLower
IF LocalRow > 23 THEN _
CALL ClearLocalUpper : _
LocalRow = 2
CALL CurLocate (LocalRow,LocalColumn)
LocalTxt$ = ""
HoldLTxt$ = ""
EXIT SUB
END IF
IF LocalColumn > 38 AND LocalTxt$ <> " " THEN
LocalColumn = 39 - LEN(HoldLTxt$)
HoldCTxt$ = STRING$((LEN(HoldLTxt$) + 1),32)
CALL CurLocate (LocalRow,LocalColumn)
CALL QuickTPut (HoldCTxt$,0)
LocalColumn = 1
LocalRow = LocalRow + 1
IF LocalRow = 12 THEN _
CALL ClearLocalLower
IF LocalRow > 23 THEN
CALL ClearLocalUpper : _
LocalRow = 2
END IF
CALL CurLocate (LocalRow,LocalColumn)
CALL QuickTPut (ZFG4$ + HoldLTxt$,0)
LocalColumn = LocalColumn + LEN(HoldLTxt$)
CALL CurLocate (LocalRow,LocalColumn)
LocalTxt$ = ""
EXIT SUB
END IF
4010 CALL CurLocate (LocalRow,LocalColumn)
IF BackSpace THEN _ ' RM10109302
CALL QuickTPut (LocalTxt$,0) _ ' RM10109302
ELSE _ ' RM10109302
CALL QuickTPut (ZFG4$ + LocalTxt$,0)
IF Bs > 0 THEN _
CALL CurLocate (LocalRow,LocalColumn) : _
RETURN
LocalColumn = LocalColumn + LEN(LocalTxt$)
4020 LocalTxt$ = ""
END SUB
'
SUB SysopVChat ' Verticl SysOp ANSI Chat routine ' RM03309401
5000 LocalColumn = 1
LocalRow = 2
RemoteColumn = 42
RemoteRow = 2
LocalTxt$ = "Hi, " + ZFirstName$ + ". Go Ahead..."
CALL LocalScreenWrite (LocalTxt$,LocalRow,LocalColumn,0) ' RM03049401
LocalColumn = 1 ' RM03049401
LocalRow = 4 ' RM03049401
HoldLTxt$ = ""
HoldRTxt$ = ""
HoldCTxt$ = ""
CALL CurLocate (RemoteRow,RemoteColumn)
ZWaitExpired = ZFalse
5010 ZAutoLogoff! = TIMER + ZWaitBeforeDisconnect
CALL Carrier
IF ZSubParm < 0 THEN _
EXIT SUB
CALL GoIdle ' RM102993
5020 CALL FindFKey
IF ZSubParm < 0 THEN _ ' RM12189303
EXIT SUB ' RM12189303
IF ZWasCM = 0 THEN _
CALL FlushCom (ZCommPortStack$) : _
ZKeyPressed$ = "" : _
ZWasCM = ZTrue : _
GOTO 5010
LocalTxt$ = ZKeyPressed$
IF ZKeyPressed$ = ZEscape$ THEN _
EXIT SUB
IF LocalTxt$ = "" THEN _
GOTO 5030
IF LocalTxt$ = CHR$(8) THEN _
GOTO 5070 _
ELSE IF LocalTxt$ = CHR$(9) THEN _
GOTO 5090 _
ELSE IF LocalTxt$ = CHR$(13) THEN _
GOTO 6010
CALL LocalScreenWrite (LocalTxt$,LocalRow,LocalColumn,0)
GOTO 5010
5030 IF ZLocalUser THEN _
GOTO 5010
IF ZCommPortStack$ <> "" THEN _
RemoteTxt$ = LEFT$(ZCommPortStack$,LEN(ZCommPortStack$) - 1) : _
CALL RemoteScreenWrite (RemoteTxt$,RemoteRow,RemoteColumn,0)
CALL EofComm (Char)
IF Char <> -1 THEN _
GOTO 5050 _
ELSE _
GOTO 5010
5050 ZAutoLogoff! = TIMER + ZWaitBeforeDisconnect
CALL GetCom (RemoteTxt$)
IF RemoteTxt$ = CHR$(8) THEN _
GOTO 6030 _
ELSE IF RemoteTxt$ = CHR$(9) THEN _
GOTO 6050 _
ELSE IF RemoteTxt$ = CHR$(13) THEN _
GOTO 6070
CALL RemoteScreenWrite (RemoteTxt$,RemoteRow,RemoteColumn,0)
GOTO 5010
5070 IF LocalColumn - 1 > 0 THEN _ ' Local Back Space
CALL LocalScreenWrite (LocalTxt$,LocalRow,LocalColumn,1)
GOTO 5010
5090 IF LocalColumn + 5 > 38 AND LocalRow < 24 THEN _ 'Local TAB
LocalColumn = 38 _
ELSE _
LocalColumn = LocalColumn + 4
LocalTxt$ = " "
CALL LocalScreenWrite (LocalTxt$,LocalRow,LocalColumn,0)
GOTO 5010
6010 LocalColumn = 38 ' Local Carriage Return
LocalTxt$ = " "
CALL LocalScreenWrite (LocalTxt$,LocalRow,LocalColumn,0)
GOTO 5010
6030 IF RemoteColumn - 1 > 41 THEN _ ' Remote Back Space
CALL RemoteScreenWrite (RemoteTxt$,RemoteRow,RemoteColumn,1)
GOTO 5010
6050 IF RemoteColumn + 5 > 79 AND RemoteRow < 24 THEN _ ' Remote TAB
RemoteColumn = 79 _
ELSE _
RemoteColumn = RemoteColumn + 4
RemoteTxt$ = " "
CALL RemoteScreenWrite (RemoteTxt$,RemoteRow,RemoteColumn,0)
GOTO 5010
6070 RemoteColumn = 79 ' Remote Carriage Return
RemoteTxt$ = " "
CALL RemoteScreenWrite (RemoteTxt$,RemoteRow,RemoteColumn,0)
GOTO 5010
END SUB
'
7000 SUB ClearScrn ' Clears the Entire screen ' RM03299401
CALL QuickTPut ("",0)
ZSubParm = 2
CALL Line25
ZSubParm = 0
CALL CurLocate (1,1)
END SUB
'
7100 SUB ClearRemoteUpper ' Clears the Upper half of Remote users screen ' RM03299401
Column = 42
FOR Row = 2 TO 13
CALL CurLocate (Row,Column)
CALL QuickTPut ("",0)
NEXT Row
END SUB
'
7200 SUB ClearLocalUpper ' Clears the Upper half of Local users screen ' RM03299401
Column = 1
FOR Row = 2 TO 13
CALL CurLocate (Row,Column)
CALL QuickTPut (STRING$(38,32),0)
NEXT Row
END SUB
'
7300 SUB ClearRemoteLower ' Clears the lower half of Remote users Screen ' RM03299401
Column = 42
FOR Row = 14 TO 23
CALL CurLocate (Row,Column)
CALL QuickTPut ("",0)
NEXT Row
END SUB
'
7400 SUB ClearLocalLower ' Clears the lower half of Local users screen ' RM03299401
Column = 1
FOR Row = 14 TO 23
CALL CurLocate (Row,Column)
CALL QuickTPut (STRING$(38,32),0)
NEXT Row
END SUB
'
7500 SUB CurLocate (Row,Column) ' Moves the cursor to desired position ' RM03299401
CALL QuickTPut ("" + MID$(STR$(Row),2) + ";" + MID$(STR$(Column),2) + "H",0)
END SUB
10410 ' $SUBTITLE: 'RecoverMsg - sub to recover deleted messages'
' $PAGE
'
' NAME -- RecoverMsg
'
' INPUTS -- PARAMETER MEANING
' MsgToRecover MESSAGE NUMBER TO RECOVER
' ZFirstMsgRecord RECORD # FOR First MSG ' RM08119301
'
' OUTPUTS -- ActionFlag SET TO 0 IF ERROR
' SET TO -1 IF No ERROR
'
' PURPOSE -- To recover deleted messages. Note that this is only
' possible if you have not compressed your message file
' using config.
'
SUB RecoverMsg (MsgToRecover,ActionFlag) STATIC ' RM08119301
FIELD #1,128 AS ZMsgRec$
MsgRec = ZFirstMsgRecord ' RM08119301
10420 GET 1,MsgRec
NumRecsInMsg = VAL(MID$(ZMsgRec$,117,4))
IF NumRecsInMsg < 1 OR MsgRec => ZNextMsgRec THEN _
ZWasY$ = "No Msg #" + _
STR$(MsgToRecover) : _
GOTO 10485
10440 IF VAL(MID$(ZMsgRec$,2,4)) <> MsgToRecover THEN _
MsgRec = MsgRec + NumRecsInMsg : _
GOTO 10420
10450 IF INSTR(ZMsgRec$,ZDeletedMsg$) <> 0 THEN _
LSET ZMsgRec$ = LEFT$(ZMsgRec$,115) + _
ZActiveMessage$ + _
MID$(ZMsgRec$,117) : _
PUT 1,LOC(1) : _
ZWasY$ = "Restored Msg #" + _
STR$(MsgToRecover) : _
ActionFlag = ZTrue : _
GOTO 10485
10480 ZWasY$ = "Msg #" + _
STR$(MsgToRecover) + _
" not Dead"
10485 CALL QuickTPut1 (ZWasY$)
END SUB
10600 ' $SUBTITLE: 'UpdateU -- Update the users record at logoff'
' $PAGE
' NAME -- UpdateU
'
' INPUTS -- PARAMETER MEANING
' ZAdjustedSecurity
' ZCurDate$
' ZDnlds
' ZElapsedTime
' ZListDir
' ZMainUserFileIndex
' ZSecsPerSession!
' ZUplds
' ZUserSecLevel
'
' OUTPUTS -- ZElapsedTime$
' ZListNewDate$
' ZSecLevel$
' ZUserDnlds$
' ZUserUplds$
'
' PURPOSE -- Update the user record for the user when the user
' exits RBBS-PC.
'
SUB UpdateU (LoggingOff) ' RM03309401
IF ZActiveUserName$ = "" OR ZFirstName$ = "" THEN _
EXIT SUB
IF ZUserFileIndex < 1 THEN _
GOTO 10607
UpdateDefaults = ZTrue
10602 ZSubParm = 6
ZWasY$ = ZLastDateTimeOn$
CALL FileLock
CALL OpenUser (ZHighestUserRecord)
FIELD 5,31 AS ZUserName$, _
15 AS ZPswd$, _
2 AS ZSecLevel$, _
14 AS ZUserOption$, _
24 AS ZCityState$, _
1 AS MachineType$, _ ' DROP174
1 AS ZDropTimes$, _ ' DROP174
1 AS ZBankTime$,_
4 AS ZTodayDl$, _
4 AS ZTodayBytes$, _
4 AS ZDlBytes$, _
4 AS ZULBytes$, _
14 AS ZLastDateTimeOn$, _
3 AS ZListNewDate$, _
2 AS ZUserDnlds$, _
2 AS ZUserUplds$, _
2 AS ZElapsedTime$
10604 GET 5,ZUserFileIndex
IF ZActiveUserFile$ = ZOrigUserFile$ THEN _
ZUplds = ZGlobalUplds : _
ZDnlds = ZGlobalDnlds : _
ZDLToday! = ZGlobalDLToday! : _
ZBytesToday! = ZGlobalBytesToday! : _
ZDLBytes! = ZGlobalDLBytes! : _
ZULBytes! = ZGlobalULBytes! : _
ZDropTimes = ZGlobalDropTimes : _ ' DROP174
ZBankTime = ZGlobalBankTime _
ELSE ZBankTime = 0
LSET ZBankTime$ = CHR$(ZBankTime)
LSET ZDropTimes$ = CHR$(ZDropTimes) ' DROP174
LSET ZLastDateTimeOn$ = ZWasY$
LSET ZCityState$ = ZWasCI$
IF UpdateDefaults THEN _
CALL DefaultU
IF ZListDir THEN _
LSET ZListNewDate$ = CHR$(VAL(MID$(ZCurDate$,7,2))) + _
CHR$(VAL(MID$(ZCurDate$,1,2))) + _
CHR$(VAL(MID$(ZCurDate$,4,2)))
10605 LSET ZUserDnlds$ = MKI$(ZDnlds)
LSET ZUserUplds$ = MKI$(ZUplds)
IF ZEnforceRatios THEN _
LSET ZTodayDl$ = MKS$(ZDLToday!) : _
LSET ZTodayBytes$ = MKS$(ZBytesToday!) : _
LSET ZDlBytes$ = MKS$(ZDLBytes!) : _
LSET ZULBytes$ = MKS$(ZULBytes!)
CALL CheckTime (ZUserLogonTime!, ZSecsUsedSession!, 2)
IF (NOT ZExitToDoors) AND LoggingOff THEN _
TempElapsed! = ZElapsedTime + _
(ZSecsUsedSession! - ZTimeCredits!) / 60 : _
ZTimeCredits! = 0 _
ELSE TempElapsed! = ZElapsedTime - ZExitToDoors*ZMinsInDoors
IF TempElapsed! < -32767 THEN _
TempElapsed! = -32767 _
ELSE IF TempElapsed! > 32767 THEN _
TempElapsed! = 32767
LSET ZElapsedTime$ = MKI$(TempElapsed!)
IF ZAdjustedSecurity THEN _
LSET ZSecLevel$ = MKI$(ZUserSecLevel)
PUT 5,ZUserFileIndex
ZSubParm = 8
CALL FileLock
IF ZActiveUserFile$ <> ZOrigUserFile$ AND LoggingOff THEN _
ZActiveUserFile$ = ZOrigUserFile$ : _
ZUserFileIndex = ZOrigUserFileIndex : _
UpdateDefaults = ZFalse : _
ZAdjustedSecurity = ZFalse : _ ' KG022502
LSET ZLastDateTimeOn$ = ZOrigDateTimeOn$ : _
GOTO 10602
10607 IF ZExitToDoors OR NOT LoggingOff THEN _
EXIT SUB
Temp = ZMinsPerSession
IF ZMaxPerDay > 0 THEN _
Temp = ZMaxPerDay - TempElapsed! : _
IF Temp > ZMinsPerSession THEN _
Temp = ZMinsPerSession
Temp = -(Temp > 0) * Temp
CALL QuickTPut1 (ZFG5$ + "You have " + ZFG7$ + STR$(Temp) + ZFG5$ + _
" minutes left for next call today" + ZEmphasizeOff$) ' RM051701/RM12169301
IF ZTimeBankInActive <> 1 AND ZMaxBank > 0 THEN _ ' RM12169301
CALL QuickTPut1 (ZFG5$ + "and " + ZFG7$ + STR$(ZGlobalBankTime) + _ ' BANK174
ZFG5$ + " Minutes Banked Time." + ZEmphasizeOff$)
CALL SkipLine (1) ' RM051901
CALL QuickTPut1 (ZFG7$ + ZFirstName$ + ZFG5$ + ", Thanks for calling " + ZFG7$ + ZRBBSName$ + _
ZFG5$ + " and please call again!" + ZColorReset$) ' RM051701/RM09269301
IF NOT ZHiLiteOff THEN _
CALL QuickTPut1 (ZColorReset$)
CALL DelayTime (8 + ZBPS)
IF ZOrigUserName$ = ZSecretName$ THEN ' MENU174 Moved from RBBS-PC.BAS
ZMenuNewDate$ = LEFT$(DATE$,6) + RIGHT$(DATE$,2) ' MENU174 to save space
ZMenuNewTime$ = LEFT$(TIME$,5) ' MENU174
ZMenuNewUpld = 0 ' MENU174
ZMenuNewUsers = 0 ' MENU174
ZMenuNewCalls = 0 ' MENU174
ZMenuNewSysop = 0 ' MENU174
' CALL RingCaller ' MENU174 Uncomment if you want to ring bell when signing off!
CALL QuickTPut1 (ZFG1$ + "SYSOP New Stats Reset." + ZColorReset$) ' MENU174/RM10119302
ZOutTxt$ = "" ' MENU174
END IF ' MENU174
CALL OpenOutW (ZNodeWorkDrvPath$ + "MNEW" + ZNodeID$ + ".DEF") ' MENU174/RM08079301
CALL PrintWorkA (ZMenuNewDate$)
CALL PrintWorkA (ZMenuNewTime$)
CALL PrintWorkA (STR$(ZMenuNewUpld))
CALL PrintWorkA (STR$(ZMenuNewUsers))
CALL PrintWorkA (STR$(ZMenuNewCalls))
CALL PrintWorkA (STR$(ZMenuNewSysop))
CLOSE 2 ' MENU174/RM100601
END SUB
10935 ' $SUBTITLE: 'DosExit -- Setup to exit to DOS for ZSysop'
' $PAGE
' NAME -- DosExit
'
' INPUTS -- PARAMETER MEANING
' ZComPort$
' ZDoorsTermType
' ZMultiLinkPresent
' ZRBBSBat$
' ZRedirectIOMethod
' ZUseDeviceDriver$
'
' OUTPUTS -- ZWasQ NUMBER OF LINES TO WRITE OUT TO
' ZRCTTYBat$
' ZUserIn$() LINES TO WRITE OUT TO ZRCTTYBat$
'
' PURPOSE -- Set up ZUserIn$() and ZWasQ in order to call "RBBSExit" and
' exit to DOS for the remote RBBS-PC sysop
'
SUB DosExit ' RM03309401
IF ZMultiLinkPresent AND _
ZDoorsTermType > 0 THEN _
ZFF = 0 : _
GOTO 10950
ZOutTxt$(1) = "ECHO OFF"
IF ZUseDeviceDriver$ <> "" THEN _
Port$ = ZUseDeviceDriver$ _
ELSE Port$ = "COM" + RIGHT$(ZComPort$,1)
IF ZRedirectIOMethod THEN _
ZFF = 5 : _
ZOutTxt$(2) = "CTTY " + _
Port$ : _
ZOutTxt$(3) = ZDiskForDos$ + _
"COMMAND" : _
ZOutTxt$(4) = "CTTY CON" : _
ZOutTxt$(5) = ZRBBSBat$ _
ELSE ZFF = 3 : _
ZOutTxt$(2) = ZDiskForDos$ + _
"COMMAND >" + _
Port$ + _
" <" + _
Port$ : _
ZOutTxt$(3) = ZRBBSBat$
10950 CALL AMorPM
CALL UpdtCalr ("Exited to DOS at " + ZTime$,2)
CALL QuickTPut1 ("RBBS-PC " + ZVersionID$)
CALL QuickTPut1 ("SysOp in Remote Console mode")
CALL RBBSExit (ZOutTxt$(),ZFF)
END SUB
10976 ' $SUBTITLE: 'WordInFile -- Searches a file to find a word'
' $PAGE
' NAME -- WordInFile
'
' INPUTS -- PARAMETER MEANING
' FilName$ FILE TO SEARCH IN
' Strng$ STRING TO SEARCH FOR
'
' OUTPUTS -- InFile WHETHER STRING Found IN FILE
'
' PURPOSE -- Searches for "Strng$" in file "FILNAME$." Used to
' limit doors and questionnaires to those specified
' in their menu files. The "Strng$" is capitalized
' but not the lines in the file, so must be exact
' case-sensitive match to be found. The only character
' that can immediately proceed or end a name to be
' found must be a blank.
'
SUB WordInFile (FilName$,Strng$,InFile) STATIC
InFile = ZFalse
CALL FindIt (FilName$)
IF NOT ZOK THEN _
EXIT SUB
WasX = 0
CALL AllCaps (Strng$)
WHILE NOT EOF(2) AND WasX < 1
LINE INPUT #2,ZOutTxt$
WasY = 1
10978 WasX = INSTR(WasY,ZOutTxt$,Strng$)
IF WasX < 1 THEN _
GOTO 10980
WasY = WasX + 1
IF WasX > 1 THEN _
IF MID$(ZOutTxt$,WasX - 1,1) <> " " THEN _
WasX = 0
IF WasX > 0 THEN _
WasL = LEN(Strng$) : _
IF LEN(ZOutTxt$) => (WasX + WasL) THEN _
IF MID$(ZOutTxt$,WasX + WasL,1) <> " " THEN _
WasX = 0
IF WasX = 0 THEN _
GOTO 10978
10980 WEND
CLOSE 2
InFile = (WasX > 0)
END SUB
10983 ' $SUBTITLE: 'DoorExit -- Setup to exit to a "door"'
' $PAGE
' NAME -- DoorExit
'
' INPUTS -- PARAMETER MEANING
' ZMultiLinkPresent
' ZNodeID$
' ZRBBSBat$
' ZWasZ$
'
' OUTPUTS -- ZWasQ NUMBER OF LINES TO WRITE OUT TO
' ZRCTTYBat$
' ZUserIn$() LINES TO WRITE OUT TO ZRCTTYBat$
'
' PURPOSE -- Set up ZUserIn$() and ZWasQ in order to call "EXITRBBS" and
' exit RBBS-PC to invoke another program
'
SUB DoorExit (ReqDoorsDef) ' RM03309401
IF ZWasZ$ = "" OR _
ZWasZ$ = "NONE" THEN _
EXIT SUB
CALL FindIt (ZWasZ$)
IF NOT ZOK THEN _
GOTO 10986
CALL BreakFileName (ZWasZ$,WasX$,ExitTo$,ExitMethod$,ZFalse)
ExitMethod$ = ""
ZDooredTo$ = ExitTo$
CALL FindIt (ZDoorsDef$)
IF NOT ZOK THEN _
IF ReqDoorsDef THEN _
EXIT SUB _
ELSE ExitTo$ = ExitTo$ + " " + ZNodeID$ : _
GOTO 10989
10985 CALL ReadParms (ZOutTxt$(),8,1)
IF ZErrCode > 0 THEN _
IF ReqDoorsDef THEN _
EXIT SUB _
ELSE ExitTo$ = ExitTo$ + " " + ZNodeID$ : _
GOTO 10989
IF ExitTo$ <> ZOutTxt$(1) THEN _
GOTO 10985
CALL CheckInt (ZOutTxt$(2))
IF ZErrCode > 0 THEN _
ZErrCode = 0 : _
GOTO 10985
IF ZUserSecLevel < ZTestedIntValue THEN _
CALL QuickTPut1 ("Insufficient security for door") : _
EXIT SUB
WasX$ = LEFT$(ZOutTxt$(5),INSTR(ZOutTxt$(5)+" "," ")-1)
CALL FindIt (WasX$)
IF NOT ZOK THEN _
GOTO 10986
ZFileName$ = ZOutTxt$(3)
ExitMethod$ = ZOutTxt$(4)
ExitTemplate$ = ZOutTxt$(5)
ZDoorDisplay$ = ZOutTxt$(7)
ZDoorTime$ = ZOutTxt$(8)
CALL AskUsers
REDIM ZUserIn$(ZMsgDim) ' RM08299301
CALL SmartText (ExitTemplate$,ZFalse,ZFalse)
CALL MetaGSR (ExitTemplate$,ZFalse)
ExitTo$ = ExitTemplate$
GOTO 10989
10986 ZOutTxt$ = "Missing door program"
CALL UpdtCalr (ZOutTxt$ + " " + ZWasZ$,1)
ZSnoop = ZTrue
CALL LPrnt (ZOutTxt$,1)
EXIT SUB
10989 IF ZTransferFunction = 3 THEN _
ZWasY$ = "Registration" _
ELSE ZWasY$ = ZDooredTo$
ZOutTxt$ = ZFG7$ + ZWasY$ + _
ZFG6$ + " door opened at " + _
ZFG7$ + TIME$ + _
ZFG6$ +" on " + _
ZFG7$ + DATE$ + ZEmphasizeOff$ ' RM051701
ZSubParm = 5
CALL TPut
CALL QuickTPut1 (ZFG7$ + "Loading Door....Please wait....." + ZEmphasizeOff$) ' RM051701
CALL UpdtCalr (ZDooredTo$ + " door opened!",2)
CALL DoorInfo
IF ExitMethod$ = "S" THEN _
CALL UpdateU (ZFalse) : _
CLOSE 4,5 : _
CALL ShellExit (ExitTemplate$) : _
ZPrevCaller$ = "" : _
CALL SetCall : _
ZExitToDoors = ZTrue : _
CALL DoorReturn : _
CALL BufFile (ZDoorDisplay$,WasX) : _
ZExitToDoors = ZFalse _
ELSE ZOutTxt$(1) = ZDiskForDos$ + _
"COMMAND /C " + _
ExitTo$ : _
ZOutTxt$(2) = ZRBBSBat$ : _
CALL RBBSExit (ZOutTxt$(),2)
END SUB
10991 ' $SUBTITLE: 'DoorInfo -- Write info for doors to file'
SUB DoorInfo ' RM03309401
CLOSE 2
OPEN "O",2,"DORINFO" + _
ZNodeFileID$ + _
".DEF"
PRINT #2,ZRBBSName$
PRINT #2,ZSysopFirstName$
PRINT #2,ZSysopLastName$
IF ZLocalUser THEN _
PRINT #2,"COM0" _
ELSE PRINT #2,ZComPort$
ZUserIn$ = MID$(ZBaudParity$, INSTR(ZBaudParity$, ","))
PRINT #2,ZTalkToModemAt$;" BAUD"; ' CM0102
IF ZReliableMode THEN PRINT #2,"-R"; ' CM0102
PRINT #2,ZUserIn$ ' CM0102
IF ZNetworkType = 7 THEN _ ' RM01109401 - MailMgr fix
NetworkType = 6 _ ' RM01109401 - MailMgr fix
ELSE _ ' RM01109401 - MailMgr fix
NetworkType = ZNetworkType ' RM01109401 - MailMgr fix
PRINT #2,NetworkType ' RM01109401 - MailMgr fix
IF ZGlobalSysop THEN _
PRINT #2,"SYSOP" : _
PRINT #2,"" _
ELSE PRINT #2,OrigFirstName$ : _ ' DGSALIAS
PRINT #2,ZLastName$
PRINT #2,ZCityState$
PRINT #2,ZWasGR
PRINT #2,ZUserSecLevel
CALL TimeRemain (MinsRemaining)
CALL CheckInt (ZDoorTime$)
IF ZErrCode = 0 AND ZTestedIntValue > 0 THEN _
IF MinsRemaining > ZTestedIntValue THEN _
MinsRemaining = ZTestedIntValue
PRINT #2,INT(MinsRemaining)
PRINT #2,ZFossil
CLOSE 2
END SUB
10992 ' $SUBTITLE: 'RBBSExit -- Setup to exit RBBS'
' $PAGE
' NAME -- RBBSExit
'
' INPUTS -- PARAMETER MEANING
' LINE.ARA Array of lines to write to batch file
' NumLines How many lines in array
'
' OUTPUTS -- ZRCTTYBat$
'
' PURPOSE -- To create a batch file that control can be passed to
' and to exit RBBS-PC while still keeping carrier up
'
SUB RBBSExit (LineAra$(1),NumLines) ' RM03309401
CLOSE 2
IF NumLines = 0 THEN _
GOTO 10994
OPEN "O",2,ZRCTTYBat$
FOR WasI = 1 TO NumLines
IF LineAra$(WasI) <> "" THEN _
PRINT #2,LineAra$(WasI)
NEXT
CLOSE 2
10994 CLOSE 3
ZExitToDoors = ZTrue
IF NOT ZFossil THEN _
OUT ZModemCntlReg,INP(ZModemCntlReg) OR 1
IF NOT ZPrivateDoor THEN _
CALL MLInit (2)
10996 CALL UpdateU (ZTrue)
CALL GetTime
CALL SaveProf (1)
IF NumLines = 0 THEN _
EXIT SUB
CALL DelayTime (9 + ZBPS)
IF ZFossil THEN _
CALL FOSExit(ZComPort)
SYSTEM
END SUB
12000 ' $SUBTITLE: 'SetSection -- Setup section prompts'
' $PAGE
' NAME -- SetSection Doug Azzarito
'
' INPUTS -- PARAMETER MEANING
' ZMenuIndex 2 = user is in MAIN section
' 3 = user is in FILE section
' 4 = user is in UTIL section
' 6 = user is in LIBR section
'
' OUTPUTS -- ZSection$ 4 character section name
' ZActiveMenu$ 1 character section name
' ZSectionPrompt$ Section name (if ZShowSection config)
' ZCmdPrompt$ Command input prompt string
' ZSectionOpts$ List of options valid in this sect
' ZInvalidOpts$ List of options invalid in this sect
' ZSubSection Index into security array for section
'
' PURPOSE -- To build the prompt strings for the current section
'
SUB SetSection ' RM03309401
IF ZMenuIndex <> 6 THEN _
ZCurDirPath$ = ZDirPath$
ON ZMenuIndex GOTO 12001, 12010,12005,12020,12001,12015
12001 EXIT SUB
12005 LSET ZSection$ = "FILE"
ZSectionOpts$ = ZFileOpts$
ZInvalidOpts$ = ZInvalidFileOpts$
ZSubSection = ZBegFile
GOTO 12025
12010 LSET ZSection$ = "MAIN"
ZSectionOpts$ = ZMainOpts$
ZInvalidOpts$ = ZInvalidMainOpts$
ZSubSection = ZBegMain
GOTO 12025
12015 LSET ZSection$ = "LIBR"
ZSectionOpts$ = ZLibOpts$
ZInvalidOpts$ = ZInvalidLibraryOpts$
ZSubSection = ZBegLibrary
ZCurDirPath$ = ZLibDirPath$
GOTO 12025
12020 LSET ZSection$ = "UTIL"
ZSectionOpts$ = ZUtilOpts$
ZInvalidOpts$ = ZInvalidUtilOpts$
ZSubSection = ZBegUtil
12025 ZActiveMenu$ = LEFT$(ZSection$,1)
LSET ZLastCommand$ = ZActiveMenu$ + " "
IF ZShowSection THEN _
ZSectionPrompt$ = ZSection$ _
ELSE ZSectionPrompt$ = "Your"
IF ZCmndsInPrompt=0 THEN _
ZSectionOpts$ = ""
ZCmdPrompt$ = ZSectionPrompt$ + _
" command" + _
ZSectionOpts$
END SUB
12878 ' $SUBTITLE: 'UntilRight - asks question until answer okay'
' $PAGE
'
' NAME -- UntilRight
'
' INPUTS -- PARAMETER MEANING
' Ques$ QUESTION TO BE ASKED THE USER
' Ans$ LOCATION TO STORE THE ANSWER
' MinLen MINIMUM LENGTH OF ANSWER
' MaxLen MAX LENGTH OF ANSWER
'
' OUTPUTS -- Ans$ RESPONSE TO THE QUESTION WHICH THE
' CALLERS SAYS IS CORRECT
'
' PURPOSE -- Subroutine to ask a user a question until the caller
' responds that the answer is correct
'
SUB UntilRight (Ques$,Ans$,MinLen,MaxLen) STATIC
12880 ZParseOff = ZTrue
ZOutTxt$ = Ques$
CALL PopCmdStack
IF ZSubParm = -1 THEN _
GOTO 12882
IF ZWasQ = 0 THEN _
GOTO 12880
IF LEN(ZUserIn$(ZAnsIndex)) > MaxLen THEN _
ZLastIndex = 0 : _
CALL QuickTPut1 (STR$(MaxLen) + " chars max") : _
GOTO 12880 _ ' RM041101
ELSE IF LEN(ZUserIn$(ZAnsIndex)) < MinLen THEN _
ZLastIndex = 0 : _
CALL QuickTPut1 (STR$(MinLen) + " chars min") : _
GOTO 12880
Ans$ = ZUserIn$(ZAnsIndex)
IF ZAnsIndex < ZLastIndex THEN _
GOTO 12881
ZOutTxt$ = ZUserIn$(ZAnsIndex) + _
", right ([Y],N)"
ZTurboKey = -ZTurboKeyUser
ZSubParm = 1
CALL TGet
IF ZSubParm = -1 THEN _
GOTO 12882
IF ZNo THEN _
GOTO 12880
12881 CALL AllCaps (Ans$)
EXIT SUB
12882 Ans$ = "GUEST"
END SUB
13660 ' $SUBTITLE: 'LogError - sub to log errors to CALLERS file'
' $PAGE
'
' NAME -- LogError
'
' INPUTS -- PARAMETER MEANING
' ERR ERROR NUMBER DETECTED BY BASIC
' ERL Last LINE NUMBER ENCOUNTERED
' PRIOR TO ENCOUNTERNING ERROR
'
' OUTPUTS -- NONE
'
' PURPOSE -- To set up a string to write to the callers log
' indicating the date, time, error, and error line
'
SUB LogError ' RM11159302
WasIX = ERR
IF ERR < 1 THEN _
WasIX = ZErrCode
CALL UpdtCalr("+++ Error " + _
STR$(WasIX) + _
" line " + _
STR$(ERL) + _
" at " + _
TIME$ + _
" on " + _
DATE$,2)
END SUB
'
20096 ' $SUBTITLE: 'CheckRatio - subroutine to print ul/dl ratio'
' $PAGE
'
' NAME -- CheckRatio
'
' INPUTS -- PARAMETER MEANING
' TellUser TELL USER THEIR RATIO
' ZDnlds FILES DOWNLOADED
' ZDLBytes! BYTES DOWNLOADED
' ZUplds FILES UPLOADED
' ZULBytes! BYTES UPLOADED
'
' OUTPUTS -- ZOK -1 if okay to download, 0 otherwise
'
' PURPOSE -- To determine whether the users violated
' their upload to download restriction
'
SUB CheckRatio (TellUser) STATIC
ZOK = ZTrue
IF ZRatioRestrict# <= 0 OR (NOT ZEnforceRatios) OR ZFreeDnld THEN _
GOTO 20110
'
' Detemine method of ratio checking. Look ahead to amount downloaded
'
IF ZByteMethod = 1 OR ZByteMethod = 3 THEN _
Method$ = "Bytes" : _
ULWork# = ZULBytes! : _
DLWork# = ZDLBytes! + ZNumDnldBytes!
IF ZByteMethod = 0 OR ZByteMethod = 2 THEN _
Method$ = "Files" : _
ULWork# = ZUplds : _
DLWork# = ZDnlds + ZDownFiles
IF ULWork# < ZInitialCredit# THEN _
ULWork# = ZInitialCredit#
IF ZByteMethod = 2 THEN _
Today# = ZRatioRestrict# - ZDLToday! - ZDownFiles
IF ZByteMethod = 3 THEN _
Today# = ZRatioRestrict# - ZBytesToday! - ZNumDnldBytes!
'
Ratio# = 0
RatioSuffix$ = ":0"
IF ULWork# > 0 THEN _
Ratio# = (DLWork# / ULWork#) : _
RatioSuffix$ = ":1"
IF ZByteMethod > 1 THEN ' DGS070301-DS
IF ZBytesToday! > 0 THEN _ ' DGS070301-DS
DGSTemp! = ZBytesToday! ' DGS070301-DS
DGSTemp! = DGSTemp! + ZNumDnldBytes! ' DGS070301-DS
ZOutTxt$ = ZFGB$ + "Today's Downloaded Files: " + _ ' DD090202
ZFGF$ + STR$(ZDLToday! + ZDownFiles) + ZCrLf$ + _ ' DD090202
ZFGB$ + "Number of Bytes Today: " + _ ' DD090701
ZFGF$ + STR$(DGSTemp!) + _ ' DGS070301-DS
ZEmphasizeOff$ ' DD090701
DGSTemp! = 0 ' DGS070301-DS
ZSubParm = 5 ' DGS070301-DS
CALL TPut ' DGS070301-DS
CALL SkipLine (1) ' DGS070301-DS
GOTO 20100 ' DGS070301-DS
END IF ' DGS070301-DS
WasX$ = STR$(Ratio#)
X = INSTR(WasX$,".")
IF X > 0 THEN _
WasX$ = LEFT$(WasX$,X+1)
ZOutTxt$ = Method$ + " Downloaded:" + STR$(DLWork#) + _
" Uploaded:" + _
STR$(ULWork#) + _
" Ratio:" + _
WasX$ + _
RatioSuffix$
ZSubParm = 5
CALL TPut
'
' CHECK TO SEE IF THE USER HAS VIOLATED THEIR UL/DL RESTRICTION
'
20100 IF NOT (ZRatioRestrict# > 0 AND TellUser) THEN _
EXIT SUB
IF ZByteMethod <= 1 THEN _
GOTO 20105
IF Today# < 0 THEN ' DGS062401-DS
ZOutTxt$ = ZFGF$ + ZBG4$ + _ ' DD082301
"Sorry, Today's Daily Download limit of" ' DD082301
IF ZBytesToday! < 0 THEN ' DGS062401-DS
ZOutTxt$ = ZOutTxt$ + STR$(ZRatioRestrict# - ZBytesToday!) ' DGS062401-DS
ELSE ' DGS062401-DS
ZOutTxt$ = ZOutTxt$ + STR$(ZRatioRestrict#) ' DGS062401-DS
END IF ' DGS062401-DS
ZOutTxt$ = ZOutTxt$ + SPACE$(1) + Method$ + " Reached" + _ ' DGS062401-DS
ZBG0$ + ZEmphasizeOff$ ' DD082301
ZOK = ZFalse ' DGS062401-DS
ZNumDnldBytes! = 0 ' DGS070301-DS
ELSE ' DGS062401-DS
ZOutTxt$ = ZFGA$ + "Download balance:" + _ ' DD082301
ZFGE$ + STR$(Today#) + SPACE$(1) + _ ' DGS062401-DS ' DD021301
ZFGF$ + Method$ + ZEmphasizeOff$ ' DD082301
ZOK = ZTrue ' RM10069308
END IF ' DGS062401-DS
ZSubParm = 5
CALL TPut
CALL SkipLine(1)
EXIT SUB
'
20105 IF Ratio# > ZRatioRestrict# OR ULWork# = 0 THEN _
ZOK = ZFalse : _
ZOutTxt$ = "Sorry, DL/UL ratio of" + _
STR$(ZRatioRestrict#) + _
":1 " + _
Method$ + " exceeded" : _
ZSubParm = 5 : _
CALL TPut : _
ZOutTxt$ = "Minimum upload of" + _
STR$(INT(((DLWork# - (ULWork# * ZRatioRestrict#)) _
/ ZRatioRestrict#) + 1)) + _
+ " " + Method$ + " required to download" _
ELSE ZOutTxt$ = "Balance remaining before upload required:" + _
STR$(INT((ULWork# * ZRatioRestrict#)-DLWork#)) + _
" " + Method$
ZSubParm = 5
CALL TPut
CALL SkipLine (1)
20110 END SUB
20140 ' $SUBTITLE: 'GetArc - sub to get what files to verbose list'
' $PAGE
'
' NAME -- GetArc
'
' INPUTS -- PARAMETER MEANING
' ZWasQ NUMBER OF ENTRIES TYPED
' ZUserIn$() ENTRIES TYPED
'
' OUTPUTS --
'
' PURPOSE -- Process the V)erbose list command.
' Takes what user types and tries to list it.
'
SUB GetArc STATIC
20141 IF ZAnsIndex >= ZLastIndex THEN _
IF LEN(ZDefaultExtension$) > 0 THEN _
CALL QuickTPut1 ("Default extension is "+ZDefaultExtension$)
WasZ$ = "V"
CALL Line25 ' RM01239401
CALL AskItems ("V",WasZ$,ZFalse,"file",ZMarkedFiles$,ZPersonalDnld) ' RM01209401
IF ZSubParm = -1 OR ZWasQ = 0 THEN _
EXIT SUB
ZViolation$ = "View ARC"
WasX = ZAnsIndex
ZAnsIndex = WasX
20142 IF ZAnsIndex > ZLastIndex THEN _
IF ZLastIndex > 1 OR Drive$ <> "" THEN _ ' KG091001
EXIT SUB _
ELSE GOTO 20141
GOSUB 20143
IF ZSubParm < 0 THEN _
EXIT SUB
ZAnsIndex = ZAnsIndex + 1
GOTO 20142
20143 ZWasZ$ = ZUserIn$(ZAnsIndex)
CALL UnMarkItems (ZMarkedFiles$,ZAnsIndex,ZLastIndex,Temp,ZFalse)
ZWasZ$ = ZUserIn$(ZAnsIndex)
WasZ$ = ZWasZ$
CALL AllCaps (ZWasZ$)
CALL BreakFileName (ZWasZ$,Drive$,Prefix$,Ext$,ZFalse)
IF Ext$ = "" THEN _
Ext$ = ZDefaultExtension$ : _
ZWasZ$ = ZWasZ$ + "." + ZDefaultExtension$
ZFileNameHold$ = ZWasZ$
ZFileName$ = ZWasZ$
CALL BadFile (Prefix$,BadFileNameIndex)
ON BadFileNameIndex GOTO 20144,20146,20147
20144 CALL BadFile (ZFileName$,BadFileNameIndex)
ON BadFileNameIndex GOTO 20145,20146,20147
20145 IF Drive$ <> "" THEN _ ' KG091001
ZFileNameHold$ = Prefix$ + "." + Ext$ : _ ' KG091001
CALL FindFile (ZFileName$,ZOK) _ ' KG091001
ELSE CALL RotorsDir (ZFileName$,ZSubDir$(),ZSubDirCount + (NOT ZSysop),ZTrue,"V") ' KG091001
IF NOT ZOK AND ZPersonalDnld THEN _ ' RM01209401
ZFileName$ = ZPersonalDrvPath$ + ZWasZ$ : _ ' RM01209401
CALL FindFile (ZFileName$,ZOK) ' RM01209401
IF ZOK THEN _
GOTO 20148
20146 CALL AllCaps(WasZ$) ' DGS041601-TH/RM10059301
ZWasZ$ = WasZ$ + _
" not found!"
CALL UpdtCalr (ZWasZ$,2)
ZOutTxt$ = ZFGB$ + ZWasZ$ + _
" Type correct filename " + ZFirstName$ + _
ZPressEnterExpert$ + ZEmphasizeOff$ ' DGS041601-TH/RM01069402
ZSubParm = 1
CALL TGet
IF ZSubParm = -1 OR ZWasQ = 0 THEN _
RETURN
ZUserIn$(ZAnsIndex) = ZUserIn$(1)
GOTO 20143
20147 CALL SecViolation
IF ZDenyAccess THEN _
EXIT SUB
GOTO 20146
20148 WasX$ = ZDiskForDos$ + "VIEW.BAT" ' RM09119301
CALL Graphic (WasX$) ' RM0911]301
IF NOT ZOK THEN _
GOTO 20150
ZGSRAra$(3) = MID$(RIGHT$(ZComPort$,1)+"0",1-ZLocalUser, 1)
CALL ReadDir (2,1)
IF EOF(2) THEN _
ZWasZ$ = ZOutTxt$ : _
ZGSRAra$(1) = ZFileName$ : _
ZGSRAra$(2) = ZArcWork$ _
ELSE ZWasZ$ = WasX$ + " " + ZFileName$ + " " + ZArcWork$ + _ ' RM09119301
" " + Ext$ + " " + ZNodeID$ + " " + ZGSRAra$(3) ' RM09119301
CALL ShellExit (ZWasZ$)
CALL BufFile (ZArcWork$,WasX)
RETURN
20150 WasX = INSTR(".ARC.PAK.ZIP.LZH.","."+Ext$+".")
'IF (WasX < 1) OR (WasX = 1 AND NOT ZTurboRBBS) THEN _
IF (WasX < 1) THEN _
CALL QuickTPut1 ("View not implemented") : _ ' RM09119301
RETURN
CALL QuickTPut1 (ZFileNameHold$ + " has these files")
CALL ViewArc
RETURN
END SUB
20235 ' $SUBTITLE: 'BadName - subroutine to find bad file names'
' $PAGE
'
' NAME -- BadName
'
' INPUTS -- PARAMETER MEANING
' ZActiveMessageFile$
' ZActiveUserFile$
' ZCallersFile$
' ZCmntsFile$
' CONFIG.FILEANAME$
' ZMainMsgBackup$
' ZMainMsgFile$
' ZMaxViolations
' ZPswdFile$
' ZRBBSBat$
' ZRCTTYBat$
' ZSubDir$()
' ZSubDirIndex
' ZViolation$
' ZViolationsThisSession
' ZWasZ$ NAME OF FILE
' ProtectExt -1 if check for extension
' 0 to allow any extension
'
' OUTPUTS -- BadFileNameIndex 1 = FILE NAME IS OK
' 2 = SECURITY BREACH TRIED
'
' PURPOSE -- To protect RBBS-PC against the use of bad file names
' to either crash the system or to breach RBBS-PC's security
'
SUB BadName (BadFileNameIndex,ProtectExt) ' RM03309401
'
'
' * TEST FOR SYSTEM FILE ATTEMPT
'
BadFileNameIndex = 2
ZWasZ$ = ZFileName$
CALL BreakFileName (ZFileName$,DR$,Prefix$,Extension$,ZFalse)
IF LEN(Extension$) = 3 AND ProtectExt THEN _
IF INSTR("DEF,MNU,OLD,PUI,BAK,",Extension$+",") > 0 THEN _
EXIT SUB
ZOK = 0
IF ProtectExt THEN _
CALL FileNameCheck (ZActiveMessageFile$,Prefix$,Extension$)
CALL FileNameCheck (ZActiveUserFile$,Prefix$,Extension$)
CALL FileNameCheck (ZCallersFile$,Prefix$,Extension$)
CALL FileNameCheck (ZCmntsFile$,Prefix$,Extension$)
CALL FileNameCheck (ZFileSecFile$,Prefix$,Extension$)
CALL FileNameCheck (ZMainMsgBackup$,Prefix$,Extension$)
CALL FileNameCheck (ZOrigMsgFile$,Prefix$,Extension$)
CALL FileNameCheck (ZOrigUserFile$,Prefix$,Extension$)
CALL FileNameCheck (ZPswdFile$,Prefix$,Extension$)
CALL FileNameCheck (ZRBBSBat$,Prefix$,Extension$)
CALL FileNameCheck (ZRCTTYBat$,Prefix$,Extension$)
CALL FileNameCheck (ZConfigFileName$,Prefix$,Extension$)
IF ZOK = 0 THEN _
BadFileNameIndex = 1
END SUB
20240 ' $SUBTITLE: 'FileNameCheck - checks file match except for drive'
' $PAGE
'
' NAME -- FileNameCheck
'
' INPUTS -- PARAMETER MEANING
' CheckThis$ Name of file to check
' Pref2$ Prefix to match against
' Ext2$ Extension to match against
'
' OUTPUTS -- ZOK 1 if got match
'
' PURPOSE -- Checks for match on both prefix and extension of a file
' name. Used to catch match on system files not to be
' downloaded.
'
SUB FileNameCheck (CheckThis$,Pref2$,Ext2$) STATIC
IF ZOK > 0 THEN _
EXIT SUB
CALL BreakFileName (CheckThis$,DR$,Pref1$,Ext1$,ZFalse)
IF Pref1$ = Pref2$ THEN _
IF Ext1$ = Ext2$ THEN _
ZOK = 1
END SUB
20245 SUB SetBPS (BaudTest!,BPS) ' RM03309401
IF BaudTest! > 0 AND BaudTest! < 50 THEN _ ' BB08219301
BaudTest! = BaudTest! * 1000 ' Support 14.4 for 14,400 ' RM10289301
IF BaudTest! = 2400 THEN _
BPS = -4 _
ELSE IF BaudTest! = 1200 OR BaudTest! = 1275 THEN _
BPS = -3 _
ELSE IF BaudTest! >= 7200 AND BaudTest! < 19200 THEN _
GOTO 20246 _
ELSE IF BaudTest! = 0 OR BaudTest! = 300 THEN _
BaudTest! = 300 : _
BPS = -1 _
ELSE IF BaudTest! = 450 THEN _ ' BB062501
BPS = -2 _ ' BB062501
ELSE IF BaudTest! = 19200 THEN _
BPS = -11 _
ELSE IF BaudTest! = 21600 THEN _ ' BB09069301
BPS = -12 _ ' BB09069301
ELSE IF BaudTest! = 24000 THEN _ ' RM11279301
BPS = -13 _ ' RM11279301
ELSE IF BaudTest! = 26400 THEN _ ' RM11279301
BPS = -14 _ ' RM11279301
ELSE IF BaudTest! = 28800 THEN _ ' BB062501
BPS = -15 _ ' BB062501/RM11279301
ELSE IF BaudTest! = 38400 THEN _
BPS = -16 _ ' BB062501/BB09039301/RM11279301
ELSE IF BaudTest! = 57600 THEN _ ' BB062501
BPS = -17 _ ' BB062501/RM11279301
ELSE IF BaudTest! = 4800 THEN _
BPS = -5 _
ELSE BPS = 0
EXIT SUB
20246 IF BaudTest! = 14400 THEN _
BPS = -9 _
ELSE IF BaudTest! = 16800 THEN _
BPS = -10 _
ELSE IF BaudTest! = 7200 THEN _
BPS = -6 _
ELSE IF BaudTest! = 12000 THEN _
BPS = -8 _
ELSE BPS = -7 ' 9600
END SUB
20340 ' $SUBTITLE: 'QuickPeek - Easy find user to send message to' ' HB030692
' $PAGE ' HB030692
' ' HB030692
' NAME -- QuickPeek ' HB030692
' ' HB030692
' PARAMETER MEANING ' PEEK174
' ' PEEK174
' INPUTS -- ZUserIn$ Search String User Input ' HB030692
' ' HB030692
' OUTPUTS -- MsgTo$ Who Message is To ' HB030692
' ' HB030692
' PURPOSE -- Save User keystrokes when looking for message addressee' HB030692
' ' HB030692
SUB QuickPeek (MsgTo$,WhoFound) STATIC ' PEEK174/RM02129401
IF WhoFound = ZTrue THEN EXIT SUB ' PEEK174
SaveTxt$ = ZOutTxt$ ' RM101801
WhichUser = 1 ' PEEK174
CALL OpenUser (ZHighestUserRecord) ' PEEK174
WHILE NOT EOF(5) ' HB030692
GET #5, WhichUser ' PEEK174
TempMsgTo$ = ZUserName$ ' PEEK174
CALL TRIM (TempMsgTo$) ' PEEK174
IF MsgTo$ = TempMsgTo$ THEN EXIT SUB ' PEEK174
InTo = INSTR(TempMsgTo$,MsgTo$)
IF InTo > 0 THEN ' PEEK174
IF TempMsgTo$ = ZSecretName$ THEN _ ' PEEK174
GOTO 20345 ' PEEK174
Temp = LEN(MsgTo$)
TempMsgToWork$ = TempMsgTo$
TempMsgToWork$ = MID$(TempMsgTo$,1,Into - 1) + ZEmphasizeOn$ + MsgTo$ + _
ZEmphasizeOff$ + ZFG7$ + MID$(TempMsgTo$,InTo + Temp)
ZOutTxt$ = ZFG6$ + SaveTxt$ + ZFG7$ + TempMsgToWork$ + _
ZFG6$ + " ( " + ZFG7$ + "Y" + ZFG6$ + ")es, [N]" + _
ZFG6$ + ")o, " + ZFG7$ + "A" + ZFG6$ + ")bort )" + ZEmphasizeOff$ ' RM101801
ZSubParm = 1 ' PEEK174
CALL TGet ' PEEK174
IF ZSubParm = -1 THEN _ ' PEEK174
EXIT SUB ' PEEK174
IF ZWasQ = 0 THEN _ ' RM02129401
GOTO 20345 ' RM02129401
CALL AllCaps (ZUserIn$) ' PEEK174/RM02129401
IF ZUserIn$ = "A" THEN _ ' PEEK174/RM02129401
EXIT SUB ' PEEK174
IF ZUserIn$ = "Y" THEN ' PEEK174/RM02129401
MsgTo$ = TempMsgTo$ ' PEEK174
WhoFound = ZTrue ' PEEK174
EXIT SUB ' PEEK174
END IF ' PEEK174
END IF
20345 WhichUser = WhichUser + 1 ' PEEK174
WEND ' PEEK174
END SUB ' PEEK174
20350 ' SUBTITLE: 'PersonalRing - Detects "Distinctive Ring" patterns from Phone Co. ' JR070101
' PAGE$ ' RM070501
' ' RM070501
' NAME: PersonalRing ' RM070501
' ' RM070501
' PARAMETER MEANING ' RM070501
' ' RM070501
' INPUTS PAnswer ' RM070501
' ' RM070501
' Sreg Setting of S0 Register ' RM070501
' ' RM070501
' PURPOSE: To distinguish the ring pattern on those phones using ' RM070501
' multiple numbers on single line utilizing the Phone ' RM070501
' Company's distinctive ring patterns. ' RM070501
' ' RM070501
DEFINT A-Z ' JR070125
SUB PersonalRing (PAnswer, Sreg) STATIC ' JR070126
20352 LOCATE 21,23 ' JR070127/MENU174
IF ZDosANSI THEN _ ' RM112102
CALL LPrnt(ZEscape$ + "[1;40;31m" + " PERSONAL RING" + _
ZEscape$ + "[00m",0) _ ' RM112102
ELSE _ ' RM112102
CALL LPrnt(" PERSONAL RING",0) ' JR070128/RM070601/RM112102
ptimeout! = TIMER ' JR070129
DO ' JR070130
DetectedRing = INP(ZModemStatusReg) AND &H40 ' JR070131
ptimeend! = TIMER ' JR070132
IF ptimeend! - ptimeout! > 5 THEN ' JR070133
LOCATE 21,23 ' JR070134/MENU174
CALL LPrnt(" ",0) ' JR070135/RM070601
EXIT SUB ' JR070136
END IF ' JR070137
LOOP UNTIL DetectedRing = 0 ' JR070138
ptimeout! = TIMER ' JR070139
DO ' JR070140
DetectedRing = INP(ZModemStatusReg) AND &H40 ' JR070141
ptimeend! = TIMER ' JR070142
IF ptimeend! - ptimeout! > 5 THEN ' JR070143
LOCATE 21,23 ' JR070144/MENU174
CALL LPrnt(" ",0) ' JR070145/RM070601
EXIT SUB ' JR070146
END IF ' JR070147
LOOP UNTIL DetectedRing > 0 ' JR070148
RingStarted! = TIMER ' JR070149
ptimeout! = TIMER ' JR070150
DO ' JR070151
DetectedRing = INP(ZModemStatusReg) AND &H40 ' JR070152
ptimeend! = TIMER ' JR070153
IF ptimeend! - ptimeout! > 5 THEN ' JR070154
LOCATE 21,23 ' JR070155/MENU174
CALL LPrnt(" ",0) ' JR070156/RM070601
EXIT SUB ' JR070157
END IF ' JR070158
LOOP UNTIL DetectedRing = 0 ' JR070159
RingStopped! = TIMER ' JR070160
RingLength! = RingStopped! - RingStarted! ' JR070161
IF Sreg = 253 THEN ' JR070162
' Telephone Ring = Regular Ring... ' JR070163
IF RingLength! > 1.5 THEN ' JR070164
PAnswer = 1 ' JR070165
END IF ' JR070166
' Telephone Ring = Short Ring... ' JR070167
ELSEIF Sreg = 252 THEN ' JR070168
IF RingLength! < 1.3 THEN ' JR070169
PAnswer = 1 ' JR070170
END IF ' JR070171
END IF ' JR070172
LOCATE 21,23 ' JR070173/MENU174
CALL LPrnt(" ",0) ' JR070174/RM070601
END SUB ' JR070175
63200 ' $SUBTITLE: 'WildCard -- Matches string to a pattern'
' $PAGE
' NAME -- WildCard
'
' INPUTS -- PARAMETER MEANING
' Pattern$ PATTERN TO CHECK
' Strng$ STRING TO FIE
'
' OUTPUTS -- ZOK True IF MATCH Found
' False IF No MATCH WAS Found
'
' PURPOSE Determine whether a string is an instance in a pattern
' supported patterns are only "?" which requires a
' character but can be any, and "*" which matches any-
' thing, including a null string. Anything else in a
' sting must be an exact match. Supports reverse
' wildcards.
'
'
SUB WildCard (Pattern$,Strng$) STATIC
63285 ZOK = ZTrue
PatPos = 0
StrPos = 0
Inc = 1
WasKT = 0
WasP = LEN(Pattern$)
WasL = LEN(Strng$)
63286 PatPos = PatPos + Inc
StrPos = StrPos + Inc
WasKT = WasKT + 1
IF WasKT > WasL THEN _
GOTO 63288
ZUserIn$ = MID$(Pattern$,PatPos,1)
IF ZUserIn$ = "*" THEN _
GOTO 63289
63287 IF ZUserIn$ <> "?" AND MID$(Strng$,StrPos,1) <> ZUserIn$ THEN _
ZOK = ZFalse : _
EXIT SUB
GOTO 63286
63288 IF PatPos >= LEN(Pattern$) OR PatPos < 1 THEN _
EXIT SUB
IF MID$(Pattern$,PatPos,1) <> "*" THEN _
ZOK = ZFalse : _
EXIT SUB
63289 IF PatPos <> WasP THEN _ ' Reverse search
Inc = -1 : _
WasP = PatPos : _
PatPos = LEN(Pattern$) + 1 : _
StrPos = LEN(Strng$) + 1 : _
WasKT = 0 : _
GOTO 63286
END SUB
63320 ' $SUBTITLE: 'ShellExit - sub to shell out from RBBS'
' $PAGE
'
' NAME -- ShellExit
'
' INPUTS -- ShellTem$ String to invoke shell with
'
' OUTPUTS -- none
'
' PURPOSE -- Delay so that strings can finish printing. Restore comm
' port on return
'
SUB ShellExit (ShellTem$) ' RM11159302
CALL DelayTime (8 + ZBPS)
IF NOT ZLocalUser THEN _
IF ZFossil THEN _
CALL FOSExit(ZComPort) _
ELSE CLOSE 3 : _
OUT ZModemCntlReg,INP(ZModemCntlReg) OR 1
CLOSE 2
CALL MetaGSR (ShellTem$,ZFalse)
SHELL ShellTem$
IF ZFossil THEN _
IF NOT ZLocalUser THEN _
CALL FOSinit(ZComPort,Result) : _
IF Result = -1 THEN _
CALL PScrn("ERROR INIT FOSSIL AFT EXTERNAL") : _
SYSTEM
CALL DelayTime (2)
CALL RestoreCom
END SUB
63400 ' $SUBTITLE: 'LockAppend - prepares for file append'
' $PAGE
'
' NAME -- LockAppend
'
' INPUTS -- ZWasEN$ Name of file to append to
'
' OUTPUTS -- none
'
' PURPOSE -- Locks and opens file to append to
'
SUB LockAppend ' RM03309401
WasBX = &H4
ZSubParm = 9
CALL FileLock
ZErrCode = 0
CALL OpenWorkA (ZWasEN$)
END SUB
63410 ' $SUBTITLE: 'UnLockAppend - cleans up after file append'
' $PAGE
'
' NAME -- UnLockAppend
'
' INPUTS -- none
'
' OUTPUTS -- none
'
' PURPOSE -- Unlocks and close file appending to
'
SUB UnLockAppend ' RM03309401
WasBX = &H4
ZSubParm = 10
CALL FileLock
CLOSE 2
END SUB
63420 ' $SUBTITLE: 'FormRead - Reads from a file into a form'
' $PAGE
'
' NAME -- FormRead
'
' INPUTS -- Template$ Display formvoke shell with
' FilName$ Data file to get values from
' FixedLength Whether file is fixed length
' DataVar # bytes data if fixed length; # fields
' if variable length
' OverStrike Whether typeover into form or insert
' RecPause Whether pause after every record displayed
' otherwise when screen fills
' OUTPUTS -- (displays data base records)
'
' PURPOSE -- Allows field oriented data base data to be displayed
' in a human readable format by substituting field
' data into template or form
'
SUB FormRead (Template$,FilName$,FixedLength,DataVar,OverStrike,RecPause) STATIC
63422 IF EOF(2) OR ZNo OR (ZErrCode > 0) OR (ZSubParm < 0) THEN _
Template$ = "" : _
EXIT SUB
IF FixedLength THEN _
CALL ReadDir (2,1) : _
ZGSRAra$(1) = ZOutTxt$ _
ELSE CALL ReadParms (ZGSRAra$(),DataVar,1)
WasX$ = Template$
CALL SmartText (WasX$,ZTrue,OverStrike)
CALL MetaGSR (WasX$,OverStrike)
CALL BufAsUnit (WasX$)
IF RecPause OR (ZPageLength > 0 AND (ZLinesPrinted >= ZPageLength-1)) THEN _
CALL PauseExit : _
EXIT SUB
GOTO 63422
END SUB
63440 ' $SUBTITLE: 'BufAsUnit - prints string with no pauses'
' $PAGE
'
' NAME -- BufAsUnit
'
' INPUTS -- Strng$ String to print
'
' OUTPUTS -- none
'
' PURPOSE -- Prints string with embedded carriage returns.
' Will never pause. Used to print when can't call TGet
'
SUB BufAsUnit (Strng$) STATIC
WasL = LEN(Strng$)
IF WasL < 1 THEN _
EXIT SUB
StartByte = 1
63450 CRat = INSTR(StartByte,Strng$,ZCarriageReturn$)
IF CRat > 0 AND CRat < WasL THEN _
CRFound = (MID$(Strng$,CRat + 1,1) = ZLineFeed$) _
ELSE CRFound = ZFalse
EOLlen = -2 * CRFound
IF CRFound THEN _
EOD = CRat _
ELSE EOD = WasL + 1
NumBytes = EOD - StartByte
ZOutTxt$ = MID$(Strng$,StartByte,NumBytes)
ZSubParm = 4
CALL TPut
CALL SkipLine (-(CRFound))
IF ZRet THEN _
EXIT SUB
StartByte = EOD + EOLlen
IF StartByte <= WasL THEN _
GOTO 63450
END SUB
63460 ' Check if macro exists and execute if does
SUB MacroExe (Strng$) STATIC
CALL Trim (Strng$)
CALL Macro (Strng$,Found)
IF NOT Found THEN _
EXIT SUB
CALL FDMACEXE ' RM061101
END SUB
63465 ' Forces a keyboard pause inside a macro
SUB PauseExit STATIC
ZSubParm = 4
ZTurboKey = -ZTurboKeyUser
ZOutTxt$ = ZMorePrompt$ + LEFT$(">",-1*ZExpertUser) + MID$("? : ",2*ZTurboKey+1,2)
ZForceKeyboard = ZTrue
ZNoAdvance = ZTrue
CALL TPut
ZLinesPrinted = 0
ZUserIn$ = ""
END SUB
63470 ' $SUBTITLE: 'SetPrompt - sub to set prompts based on user security'
' $PAGE
'
' NAME -- SetPrompt
'
' INPUTS -- PARAMETER MEANING
' ZBegMain POSITION START OF MAIN CMDS
' ZBegFile POSITION START OF FILE CMDS
' ZBegUtil POSITION START OF UTIL CMDS
' ZBegLibrary POSITION START OF Library CMDS
'
' OUTPUTS -- PRESENT.OPTS$ DISPLAY WHAT USER CAN DO (1st)
' CALLERS.OPTS$ DISPLAY WHAT USER CAN DO (2nd)
' ZMainOpts$ MAIN OPTS USER CAN DO
' ZFileOpts$ FILE OPTS USER CAN DO
' ZUtilOpts$ UTIL OPTS USER CAN DO
' ZLibOpts$ Library OPTS USER CAN DO
'
' PURPOSE -- Sets command line display of what user can do by
' section and display of what all user can do
'
SUB SetPrompt STATIC
First = ZBegMain
Last = ZBegFile - 1
CALL SetOpts (ZMainOpts$,ZInvalidMainOpts$,First,Last)
First = ZBegFile
Last = ZBegUtil - 1
CALL SetOpts (ZFileOpts$,ZInvalidFileOpts$,First,Last)
First = ZBegUtil
Last = ZBegLibrary - 1
CALL SetOpts (ZUtilOpts$,ZInvalidUtilOpts$,First,Last)
First = ZBegLibrary
Last = ZBegLibrary + 6
CALL SetOpts (ZLibOpts$,ZInvalidLibraryOpts$,First,Last)
First = 50
Last = 56
CALL SetOpts (SysOpt$,ZInvalidSysOpts$,First,Last)
First = 46
Last = 49
CALL SetOpts (GlobalOpts$,InvalidGlobalOpts$,First,Last)
IF LEN(SysOpt$) > 0 THEN _
ZSystemOpts$ = "Sysop: " + _
SysOpt$
ZMainOpts$ = GlobalOpts$ + ZMainOpts$ + _
MID$(ZAllOpts$,INSTR(ZOrigCommands$,"G"),1)
ZFileOpts$ = GlobalOpts$ + _
ZFileOpts$
ZUtilOpts$ = GlobalOpts$ + _
ZUtilOpts$
ZLibOpts$ = GlobalOpts$ + _
ZLibOpts$
CALL SortString (SysOpt$)
CALL SortString (ZMainOpts$)
ZMainOpts$ = ZMainOpts$ + _
SysOpt$
CALL SortString (ZFileOpts$)
CALL SortString (ZUtilOpts$)
CALL SortString (ZLibOpts$)
CALL AddCommas (ZMainOpts$)
CALL AddCommas (ZFileOpts$)
CALL AddCommas (ZUtilOpts$)
CALL AddCommas (ZLibOpts$)
ZDirPrompt$ = "What directory(s) (" + _
MID$("U)pload,A)ll,P)ers,L)ist,E)xtended +/-, [Q]uit)",8 * (ZUserSecLevel => ZMinSecToView) + 9)
ZQuitPromptExpert$ = "QUIT C,S, or to F,[M],U,@"
ZQuitPromptNovice$ = "QUIT C)onference, S)ession or to section " + _
"F)ile, [M]ain, U)til or @)Library"
ZQuitList$ = "FMUS@C"
IF ZUserSecLevel < ZOptSec(18) THEN _
ZQuitPromptExpert$ = LEFT$(ZQuitPromptExpert$,23) : _
ZQuitPromptNovice$ = LEFT$(ZQuitPromptNovice$,61) : _
MID$(ZQuitList$,5) = " "
IF ZUserSecLevel < ZOptSec(15) THEN _
ZQuitPromptExpert$ = LEFT$(ZQuitPromptExpert$,22) + _
MID$(ZQuitPromptExpert$,25) : _
ZQuitPromptNovice$ = LEFT$(ZQuitPromptNovice$,56) + _
MID$(ZQuitPromptNovice$,63) : _
MID$(ZQuitList$,3,1) = " "
IF ZUserSecLevel < ZOptSec(6) THEN _
ZQuitPromptExpert$ = LEFT$(ZQuitPromptExpert$,16) + _
MID$(ZQuitPromptExpert$,19) : _
ZQuitPromptNovice$ = LEFT$(ZQuitPromptNovice$,41) + _
MID$(ZQuitPromptNovice$,49) : _
MID$(ZQuitList$,1,1) = " "
CALL SetSection
END SUB
63480 ' $SUBTITLE: 'NoPath - detects whether string has path'
' $PAGE
'
' NAME -- NoPath
'
' INPUTS -- Strng$ String to check
'
' OUTPUTS -- HAS.NONE True if has no path
'
' PURPOSE -- Detects whether have path. Used when shouldn't
' be any
'
SUB NoPath (Strng$,HasPath) ' RM11159302
CALL BreakFileName (Strng$,DrvPath$,Prefix$,Ext$,ZFalse)
HasPath = (DrvPath$ <> "")
END SUB
63490 ' $SUBTITLE: 'FindIt - Determine whether file exists'
' $PAGE
'
' NAME -- FindIt
'
' INPUTS -- FilName$ File name to check
'
' OUTPUTS -- ZOK True if file exists. Opened as #2 if does
'
' PURPOSE -- Determine whether file exists and open as standard work
' file if it does (#2)
'
SUB FindIt (FilName$) ' RM11159302
CALL FindItX (FilName$,2)
END SUB
SUB ReadParms (AraToUse$(1),NumParms,WhichLine) ' RM11159302
CALL ReadParmsX (2,AraToUse$(),NumParms,WhichLine)
END SUB
63495 ' $SUBTITLE: 'TimeBack - Give time back to the user'
' $PAGE
'
' NAME -- TimeBack
'
' INPUTS -- Index = 1 Set start of time (begin give back)
' = 2 Give back time from defined start
'
' OUTPUTS -- ZTimeCredits! Number of seconds to credit with
' ZSecsPerSession! Number of seconds in current session
'
' PURPOSE -- Give time back to the user (e.g. sysop initiated chat)
'
SUB TimeBack (Index) ' RM11159302
IF Index = 1 THEN _
CALL TimeRemain (MinsRemaining) : _
ZWasQ! = ZSecsUsedSession! : _
EXIT SUB
CALL TimeRemain (MinsRemaining)
WasX! = (ZSecsUsedSession! - ZWasQ!)
ZTimeCredits! = ZTimeCredits! + WasX!
END SUB
63510 ' $SUBTITLE: 'VerifyAns - edits an answer'
' $PAGE
'
' NAME -- VerifyAns
' MEANING
' INPUTS -- ZVerifying Whether verifying
' ZUserIn$(1) Response verifying
' ZVerifyList$ List of appropriate answers. 1st
' char is what separates answers
' ZVerifyNumeric Verify that is a valid integer
' if false, then verifying that
' a string is between 2 values
' ZVerifyLow$ Lowest ok value of string
' ZVerifyHigh$ Highest ok value of string
'
' OUTPUTS -- ZOK Whether passes verification
' ZVerifyList$ Empties if ok
' ZVerifying Sets false if ok
' ZVerifyNumeric Sets false if ok
'
' PURPOSE -- Processes edits on a user input
'
SUB VerifyAns STATIC
ZOK = ZTrue
IF NOT ZVerifying THEN _
EXIT SUB
Temp$ = ZUserIn$(1)
CALL AllCaps (Temp$)
IF ZVerifyList$ <> "" THEN _
WasX$ = LEFT$(ZVerifyList$,1) : _
ZOK = (INSTR (ZVerifyList$, WasX$+Temp$+WasX$) > 0) _
ELSE IF ZVerifyNumeric THEN _
CALL CheckInt (ZUserIn$) : _
ZOK = (ZErrCode = 0 AND _
ZTestedIntValue >= VAL(ZVerifyLow$) AND _
ZTestedIntValue <= VAL(ZVerifyHigh$)) _
ELSE ZOK = (Temp$ >= ZVerifyLow$ AND Temp$ <= ZVerifyHigh$)
IF ZOK THEN _
ZVerifyList$ = "" : _
ZVerifying = ZFalse : _
ZVerifyNumeric = ZFalse
END SUB
63520 ' $SUBTITLE: 'BinSearch - binary search a file'
' $PAGE
'
' NAME -- BinSearch
' MEANING
' INPUTS -- PassedSearchFor$ Value you are looking for
' StartPos Starting position of sort key
' NumChars # of characters in sort key
' LenRec Length of record of data file searching
' High& Record # of last record ' LRGE174/YB102001
' ZFastTabs$ In a binary integer subfield (2 bytes)
' holds 1st record when might find
' a key beginning with a particular
' character (0-9,A-Z). Empty if
' no Fast Tab exists for the file.
'
' OUTPUTS -- RecFoundAt& Record # value found at (0 if none) ' LRGE174/RM112801
' RecFound$ Full data record when found
'
' PURPOSE -- Binary searches work file #2 for a key value in a
' data file that is sorted on a key field
'
SUB BinSearch (PassedSearchFor$,StartPos,NumChars,LenRec,High&,RecFoundAt&,RecFound$,FilNum) STATIC ' LRGE174/YB102001/RM01229401
SearchFor$ = LEFT$(PassedSearchFor$,NumChars)
SearchFor$ = SearchFor$ + SPACE$(NumChars-LEN(SearchFor$))
FIELD FilNum, LenRec AS SearchRec$ ' RM01229401
Low& = 0 ' LRGE174/YB102001
IF LEN(ZFastTabs$) < 160 THEN _ ' TAB174/RM070693
GOTO 63522
WasX$ = LEFT$(SearchFor$,1)
WasX = INSTR("!#$0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_",WasX$) ' TAB174/RM070693
IF WasX > 0 THEN _
Low& = CVL(MID$(ZFastTabs$,1+4*(WasX-1),4)) - 1 : _ ' LRGE174/YB102001/TAB174/RM070693/0711
IF WasX < 40 THEN _ ' TAB174
High& = CVL(MID$(ZFastTabs$,1+4*WasX,4)) ' LRGE174/YB102001/TAB174/RM070693/0711
63522 RecFoundAt& = 0 ' LRGE174/YB102001
IF High& < 1 THEN _ ' LRGE174/YB102001
EXIT SUB
WasX$ = SPACE$ (NumChars)
Done = ZFalse
WHILE NOT Done
WasI& = CLNG(INT(((High&/2) + (Low&/2)) + .5)) ' LRGE174/YB102001
GET FilNum, WasI& ' LRGE174/YB102001/RM01229401
LSET WasX$ = MID$(SearchRec$, StartPos, NumChars)
IF WasX$ = SearchFor$ THEN _
RecFound$ = SearchRec$: _
RecFoundAt& = WasI& : _ ' LRGE174/YB102001
Done = ZTrue _
ELSE IF (High& - Low&) < 2 THEN _ ' LRGE174/YB102001
Done = ZTrue _
ELSE IF WasX$ < SearchFor$ THEN _
Low& = WasI& _ ' LRGE174/YB102001
ELSE IF WasX$ > SearchFor$ THEN _
High& = WasI& ' LRGE174/YB102001
WEND
END SUB
63530 ' Take modem offhook
SUB TakeOffHook ' RM11159302
CALL ModemPut (ZModemGoOffHookCmd$)
CALL DelayTime (3)
END SUB
63540 ' Match Name to one in message file
SUB ChkMsgName (MsgFromCaller,MsgToCaller) STATIC
IF NOT ZRemoteSysop THEN ' DGSALIAS
WasX$ = LEFT$("SYSOP",-5*ZSysop) ' DGSALIAS
CALL MsgNameMatch (ZOrigUserName$,WasX$,6,MsgFromCaller) ' DGSALIAS
CALL MsgNameMatch (ZOrigUserName$,WasX$,37,MsgToCaller) ' DGSALIAS
IF ZAliasMode THEN ' DGSALIAS
CALL MsgNameMatch (ZActiveUserName$,WasX$,6,MsgFromCaller) ' DGSALIAS
CALL MsgNameMatch (ZActiveUserName$,WasX$,37,MsgToCaller) ' DGSALIAS
END IF ' DGSALIAS
EXIT SUB
END IF ' DGSALIAS
CALL MsgNameMatch ("SYSOP",ZSysopFullName$,6,MsgFromCaller)
IF NOT MsgFromCaller THEN _
CALL MsgNameMatch (ZOrigUserName$,"",6,MsgFromCaller)
CALL MsgNameMatch ("SYSOP",ZSysopFullName$,37,MsgToCaller)
IF NOT MsgToCaller THEN _
CALL MsgNameMatch (ZOrigUserName$,"",37,MsgToCaller)
END SUB
SUB MsgNameMatch (PrimeName$,AltName$,SearchPos,Found) STATIC
WasX$ = LEFT$(PrimeName$+" ",22-8*(SearchPos < 7))
GOSUB 63542
IF Found OR AltName$ = "" THEN _
EXIT SUB
WasX$ = LEFT$(AltName$ + " ",22-8*(SearchPos < 7))
GOSUB 63542
EXIT SUB
63542 WasY$ = MID$(ZMsgRec$,SearchPos,LEN(WasX$))
ZWasDF = INSTR(WasY$,"@")
IF ZWasDF > 0 THEN _
MID$(WasY$,ZWasDF) = " "
Found = (WasY$ = WasX$)
RETURN
END SUB
63550 ' Check whether message record is a msg header record
SUB ChkIfMsgHeader STATIC
ZOK = ZFalse
IF MID$(ZMsgRec$,70,1) = "-" AND MID$(ZMsgRec$,73,1) = "-" THEN _
WasY = ASC(MID$(ZMsgRec$,116,1)) : _
IF WasY > 224 AND WasY < 227 THEN _
ZOK = ZTrue
END SUB
63560 ' Set specified user flag
SUB SetUserFlag (RcvrRecNum, ChangeIndex, WhatGetting$) STATIC
FIELD #5, 128 AS ZUserRecord$
IF RcvrRecNum > 0 THEN _
ZUserFileIndex = RcvrRecNum : _
ZSubParm = 6 : _
CALL FileLock : _
GET 5, RcvrRecNum : _
WasX = CVI(MID$(ZUserRecord$,57,2)) : _
MID$(ZUserRecord$,57,2) = MKI$(WasX OR ChangeIndex) : _
PUT 5, RcvrRecNum : _
ZSubParm = 8 : _
CALL FileLock : _
IF NOT ZWelcomeAboard THEN _ ' NEWU174
CALL QuickTPut1 (ZWorkAra$(1) + " will be notified of new " + WhatGetting$) : _ ' NEWU174
RcvrRecNum = 0
END SUB
63580 ' Displays user record
SUB DispUserRec (ToPrint) STATIC
ZOK = ZFalse
WasX$ = MID$(ZUserRecord$,ZStartHash,ZLenHash)
IF ASC(WasX$) = 0 OR LEFT$(WasX$,3) = " " THEN _
EXIT SUB
WasOF = CVI(ZSecLevel$)
IF WasOF > ZUserSecLevel THEN _
IF NOT ZGlobalSysop THEN _
EXIT SUB
ZOutTxt$ = ZFG4$ + RIGHT$(" " + STR$(LOC(5)),4) + _
":" + _
ZFG1$ + ZUserName$ + _
ZFG2$ + "SECURITY" + _
RIGHT$(" " + STR$(WasOF),6) + _
" "
ZOutTxt$ = ZOutTxt$ + _
ZFG3$ + "Password= " + _
ZPswd$ + ZEmphasizeOff$
GOSUB 63583
IF WasOF < ZOrigMainSec THEN _
ZOutTxt$ = ZEmphasizeOn$ + "<Locked out>" + ZEmphasizeOff$ + SPACE$(7) _
ELSE IF WasOF >= ZSysopSecLevel THEN _
ZOutTxt$ = ZEmphasizeOn$ + " (SysOp) " + ZEmphasizeOff$ + SPACE$(8) _
ELSE ZOutTxt$ = SPACE$(19)
ZOutTxt$ = ZOutTxt$ + _
ZLastDateTimeOn$ + _
" " + _
ZFG4$ + ZCityState$ + ZEmphasizeOff$
GOSUB 63583
ZOutTxt$ = " DOWNLOADS = " + _
RIGHT$(" " + STR$(CVI(ZUserDnlds$)),5) + _
" " + _
"UPLOADS = " + _
RIGHT$(" " + STR$(CVI(ZUserUplds$)),5) + _
" " + _
" Times on ="
ZOutTxt$ = ZOutTxt$ + RIGHT$(" " + STR$(CVI(MID$(ZUserOption$,1,2))),5) + _
" TIME USED= " + _
STR$(CVI(ZElapsedTime$)) + _
" Min"
GOSUB 63583
ZOutTxt$ = " Bank Time : " +_
RIGHT$(" " + STR$(ASC(ZBankTime$)),5)
ZOutTxt$ = ZOutTxt$ + " Dropped Carriers : " + _ ' DROP174
RIGHT$(" " + STR$(ASC(ZDropTimes$)),5) ' DROP174
GOSUB 63583
IF NOT ZEnforceRatios THEN _
GOTO 63581
ZOutTxt$ = "BYTES: Dwn=" + STR$(CVS(ZDlBytes$)) + _
" Up=" + STR$(CVS(ZULBytes$)) + _
" TODAY Dwn: #=" + STR$(CVS(ZTodayDl$)) + _
" Bytes=" + STR$(CVS(ZTodayBytes$))
GOSUB 63583
63581 IF (ZStartIndiv = 0 OR ZLenIndiv = 0) AND _
(ZStartHash = 0 OR ZLenHash = 0) AND _
NOT ZRestrictByDate THEN _
GOTO 63582
IF (ZStartHash > 1 AND ZLenHash > 0) THEN _
ZOutTxt$ = "Hash: " + MID$(ZUserRecord$,ZStartHash,ZLenHash) _
ELSE ZOutTxt$ = ""
IF (ZStartIndiv > 1 AND ZLenIndiv > 0) THEN _
ZOutTxt$ = ZOutTxt$ + " Indiv: " + MID$(ZUserRecord$,ZStartIndiv,ZLenIndiv)
IF ZRestrictByDate THEN _
CALL SetRegDisplay : _
ZOutTxt$ = ZOutTxt$ + " Registered: " + _
ZRegDisplayDate$
GOSUB 63583
63582 ZOK = ZTrue
EXIT SUB
63583 IF ToPrint THEN _
CALL Printit (ZOutTxt$)
CALL QuickTPut1 (ZOutTxt$)
RETURN
END SUB
63585 ' * CALCULATE REGISTRATION DATES
' checks proposed new registration date
SUB ResetRegDate (WorkDate$) STATIC ' Formerly 11470
IF LEN(WorkDate$) < 10 THEN _
WorkDate$ = LEFT$(WorkDate$,6) + _
"19" + _
RIGHT$(WorkDate$,2)
ZTodayRegYY = VAL(MID$(WorkDate$,7))
ZTodayRegMM = VAL(LEFT$(WorkDate$,2))
ZTodayRegDD = VAL(MID$(WorkDate$,4,2))
ZOK = ZTodayRegYY > 1979 AND ZTodayRegMM > 0 AND _
ZTodayRegMM < 13 AND ZTodayRegDD > 0 AND _
ZTodayRegDD < 32
IF ZOK THEN _
CALL TwoByteDate (ZTodayRegYY,ZTodayRegMM,ZTodayRegDD,ZRegDate$)
END SUB
' Sets display of registration date
SUB SetRegDisplay STATIC ' Formerly 11480
WasX$ = MID$(ZUserOption$,11,2)
IF CVI(WasX$) <> 0 THEN _
ZRegDate$ = WasX$ : _
ELSE CALL RegToCurrent
CALL UnPackDate (ZRegDate$,ZUserRegYY,ZUserRegMM,ZUserRegDD,ZRegDisplayDate$)
IF CVI(WasX$) = 0 THEN _
ZRegDisplayDate$ = "00-00-00"
END SUB
' Sets registration date to current date
SUB RegToCurrent ' Formerly 11482/RM11159302
WorkDate$ = DATE$
CALL ResetRegDate (WorkDate$)
END SUB
63590 ' ChangeInt - General routine to get an integer value.
' Calling program has option to show current
' value in prompt (ShowCur) when changing from
' an old value to a new one, passing current
' value in CurVal. Txt$ is part of prompt that
' calling program contributes. Is whole prompt
' if not showing old value, otherwise is just
' description of what value represents.
' Pass the inclusive minimum values (MinVal)
' and maximum values (MaxVal).
' Returns the value gotten in ZTestedIntValue.
'
SUB ChangeInt (ShowCur,Txt$,CurVal,MinVal,MaxVal) STATIC
IF ZAnsIndex < ZLastIndex THEN _
GOTO 63594
63592 IF Showcur THEN _
CALL QuickTPut ("Change ",0) : _
CALL QuickTPut (Txt$,0) : _
CALL QuickTPut (" from ",0) : _
CALL QuickTPut (STR$(CurVal),0) : _
CALL QuickTPut (" to (",0) _
ELSE CALL QuickTPut (Txt$,0) : _
CALL QuickTPut (" (",0)
IF ZGetExtDesc THEN _ ' BC-DESC/RM012601
CALL QuickTPut (STR$(MinVal + 1),0) _ ' BC-DESC/RM012601
ELSE _ ' BC-DESC/RM012601
CALL QuickTPut (STR$(MinVal),0)
CALL QuickTPut (" -",0)
IF ZGetExtDesc THEN _ ' BC-DESC/RM012601
CALL QuickTPut (STR$(MaxVal + 1),0) _ ' BC-DESC/RM012601
ELSE _ ' BC-DESC/RM012601
CALL QuickTPut (STR$(MaxVal),0)
ZOutTxt$ = ", [Q]uit)"
63594 CALL PopCmdStack
Temp$ = ZUserIn$(ZAnsIndex)
CALL AllCaps (Temp$)
CALL Trim (Temp$)
IF ZSubParm > -1 AND Temp$ <> "Q" AND ZWasQ <> 0 THEN _
GOTO 63595
ZWasQ = 0
IF ShowCur THEN _
CALL QuickTPut1 ("Unchanged")
EXIT SUB
63595 IF ZGetExtDesc THEN _ ' BC-DESC/RM012601
CALL CheckInt (STR$(VAL(Temp$) - 1)) _ ' BC-DESC/RM012601
ELSE _ ' BC-DESC/RM012601
CALL CheckInt (Temp$) ' BC-DESC/RM012601 63595
IF ZTestedIntValue < MinVal OR ZTestedIntValue > MaxVal THEN _
ZLastIndex = 0 : _
CALL QuickTPut1 ("Min " + STR$(MinVal) + ", Max " + STR$(MaxVal)) : _
GOTO 63592
IF ShowCur THEN _
CALL QuickTPut1 ("Set to " + STR$(ZTestedIntValue))
END SUB
63600 ' MarkItems - Converts a list of items ZUserIn$(), items ZAnsIndex
' thru ZLastIndex, into a marked list MarkedList$.
'
' Will also check for the existance of the file, for security breech,
' display a macro if one applies, and display to the user the filename,
' filesize and approximate time to download the file
'
SUB MarkItems (IsMarking,MarkedList$,MarkedDesc$,PersonalDnld) ' RM01209401
IF NOT IsMarking THEN _
EXIT SUB
IF ZFileSysParm < 1 THEN ' DGS101001-DS
FOR MarkNum = ZAnsIndex to ZLastIndex ' DGS101001-DS
MarkedList$ = MarkedList$ + ZUserIn$(MarkNum) + ZCarriageReturn$ ' DGS101001-DS
NEXT ' DGS101001-DS
CALL ReportMarked (MarkedList$,MarkedDesc$) ' DGS101001-DS
EXIT SUB ' DGS101001-DS/RM01069401
END IF ' DGS101001-DS
FirstMark = ZFalse ' RM02019401
IF MarkedList$ = "" THEN _ ' RM02019401
FirstMark = ZTrue ' RM02019401
DidTitle = ZFalse ' DGS092201-DS
IF MarkedDesc$ = "wild" THEN ' DGS101602-DS/RM03129401
WildName$ = ZNodeWorkDrvPath$ + "WILD" + ZNodeId$ + ".DEF"
FilNum = FREEFILE ' RM03129401
CALL OpenRand2 (WildName$,13,FilNum) ' DGS101602-DS/RM03129401/RM03279401
FIELD FilNum,12 AS WildFileName$, _ ' DGS101602-DS/RM03129401
1 AS WildCr$ ' DGS101602-DS
HighRec = LOF(FilNum)\13 ' RM03279401
END IF ' DGS101602-DS/RM03129401
FOR Temp = ZAnsIndex to ZLastIndex ' DGS092201-DS
IF MarkedDesc$ = "wild" THEN ' DGS101602-DS
IF ABS(INT(VAL(ZUserIn$(Temp)))) > HighRec THEN _ ' RM03279401/RM04069402
CALL QuickTPut1 (ZFG5$ + "No such file number " + ZFG7$ + _
ZUserIn$(Temp) + ZEmphasizeOff$) : _ ' RM03279401
GOTO 63603 ' RM03279401
GET FilNum,ABS(INT(VAL(ZUserIn$(Temp)))) ' DGS101602-DS/RM03129401/RM04069402
MarkFileName$ = WildFileName$ ' DGS101602-DS
CALL Trim(MarkFileName$) ' DGS101602-DS
ELSE ' DGS101602-DS
MarkFileName$ = UCASE$(ZUserIn$(Temp)) ' DGS101602-DS/RM01139401
END IF ' DGS101602-DS
CALL Carrier ' RM/GS02129401
IF ZSubParm = -1 THEN ' RM/GS02129401
IF MarkedDesc$ = "wild" THEN _ ' RM03129401
CLOSE FilNum ' RM03129401
EXIT SUB ' RM/GS02129401
END IF ' RM03129401
MarkingTime = ZFalse ' DGS092201-DS
MarkFileNameHold$ = MarkFileName$ ' RM01269401
ZFileName$ = MarkFileNameHold$ ' RM01269401
IF INSTR(MarkedList$,MarkFileName$) > 0 THEN _ ' RM01049401/RM01139401
CALL QuickTPut1 (ZFG7$ + MarkFileName$ + ZFG5$ + " is already " + _
"marked for download!" + ZEmphasizeOff$) : _ ' RM01049401/RM01139401
GOTO 63603 ' RM01049401
CALL Remove (MarkFileName$,", ") ' RM01049401/RM01139401
IF INSTR(MarkFileName$,".") = 0 THEN _ ' DS101602-DS/RM01139401
MarkFileNameAlt$ = MarkFileName$ : _ ' /RM01269401
MarkFileName$ = MarkFileName$ + "." + ZDefaultExtension$ _ ' DGS101602-DS/RM01139401
ELSE _ ' RM01269401
MarkFileNameAlt$ = ""
CALL BadFile (MarkFileName$,BadFileNameIndex) ' RM01049401/RM01139401
ON BadFileNameIndex GOTO 63601,63602,63604 ' RM01049401
63601 CALL RotorsDir (MarkFileName$,ZSubDir$(),ZSubDirCount + _ ' DGS101602-DS/RM01139401
((ZUserSecLevel < ZMinSecToView) OR _ ' DGS101602-DS
NOT ZCanDnldFromUp),MarkingTime,"D") ' DGS092201-DS/RM01049401
IF ZAbort OR ZDotFlag THEN _ ' RM03219401/RM04099401
ZAbort = ZFalse : _ ' RM03219401
GOTO 63603 ' RM03219401
CALL BreakFileName (MarkFileName$,Dr$,WasY$,WasX$,ZTrue) ' RM01209401
IF NOT ZOK AND PersonalDnld THEN _ ' RM01209401
MarkFileName$ = ZPersonalDrvPath$ + WasY$ + WasX$ : _ ' RM01209401
CALL FindFile (MarkFileName$,ZOK) ' RM01209401
IF ZOK THEN ' DGS092201-DS
IF NOT DidTitle THEN _ ' DGS092201-DS/RM01069401
CALL MarkFileHeader : _ ' RM01069401
DidTitle = ZTrue ' RM01069401
CALL FormatMarkedFileDisplay (MarkFileName$,WasY$ + WasX$,FirstMark) ' RM01049401/RM01139401/RM01229401/RM02019401
MarkedList$ = MarkedList$ + WasY$ + WasX$ + ZCarriageReturn$ ' DGS092201-DS/RM01229401
FirstMark = ZFalse ' RM02059402
GOTO 63603 ' RM01049401
ELSE ' DGS101001-DS
IF MarkFileNameAlt$ <> "" THEN _ ' RM01049401/RM01269401
MarkFileName$ = MarkFileNameAlt$ : _ ' RM01049401/RM01139401
MarkFileNameAlt$ = "" : _ ' RM01049401/RM01269401
GOTO 63601 ' RM01049401
63602 ZOutTxt$ = ZFGC$ + MarkFileNameHold$ + ZFGF$ + " not found!" + _ ' DGS101603-DS/RM01139401/RM01269401
" Correct name" + ZPressEnterExpert$ + ZEmphasizeOff$ ' DGS101603-DS
ZSuspendAutoLogoff = ZFalse ' RM01049401
ZSubParm = 1 ' DGS101001-DS
CALL TGet ' DGS101001-DS
IF ZSubParm < 0 THEN ' DGS101001-DS
ZFileSysParm = 2 ' DGS101001-DS
IF MarkedDesc$ = "wild" THEN _ ' RM03129401
CLOSE FilNum ' RM03129401
EXIT SUB ' RM01049401
END IF ' RM03129401
IF ZWasQ = 0 THEN _ ' RM01049401
GOTO 63603 ' RM01049401
ZUserIn$(Temp) = ZUserIn$(1) ' DGS101001-DS/RM01049401
Temp = Temp - 1 ' RM01049401
END IF ' DGS101001-DS
63603 NEXT ' DGS101001-DS
IF MarkedDesc$ = "wild" THEN _ ' DGS011601-DS
CLOSE FilNum ' DGS011601-DS/RM03129401
CALL ReportMarked (MarkedList$,MarkedDesc$)
EXIT SUB ' DGS092201-DS
63604 ZViolation$ = "Marking File " + MarkFileName$ ' RM01049401/RM01139401
CALL SecViolation ' RM01049401
IF ZDenyAccess THEN _ ' RM01049401
ZFileSysParm = 4 : _ ' RM01049401
EXIT SUB ' RM01049401
GOTO 63602 ' RM01049401
END SUB
'
SUB FormatMarkedFileDisplay (FilName$,DFilName$,FirstMark) STATIC ' RM01049401/RM02019401
IF ZUserXferDefault$ = "N" THEN ' DGS091701-DS/DGS03129401-DS
ZSpeedFactor! = .95 ' Most use Zmodem Nowadays for this calc ' DGS091701-DS
ZFLen = 1024 ' DGS091701-DS
END IF ' DGS101001-DS
IF FirstMark THEN _ ' RM02019401
TotBlocks# = 0 ' RM02019401
FilNum = FREEFILE ' RM03129401
CALL OpenRSeq (FilName$,MaxBlock&,LenLastRec,ZFLen,FilNum) ' RM01139401/RM03129401
DGSBytesInFile# = LOF(FilNum) ' DGS091701-DS/RM03129401
CLOSE FilNum ' DGS091701-DS/RM01049401/RM03129401
DGSBlocksInFile# = MaxBlock& ' DGS091701-DS/01049401
Blocks# = DGSBlocksInFile# / _ ' DGS091701-DS
VAL(MID$("00000300045012002400480072009601200144016801920216024002640288038405760", -4 * ZCBPS, 4)) ' BB08219301/BB09039301/RM11279301
Blocks# = Blocks# * ZFLen / ZSpeedFactor! ' MARK174' DGS091701-DS
TotBlocks# = TotBlocks# + Blocks#
Estimate$ = RIGHT$(SPACE$(5) + STR$(INT(Blocks#/60)),5) + ":" + _ ' DGS091701-DS
RIGHT$(STRING$(2,48) + _ ' DGS091701-DS
LTRIM$(STR$(INT(Blocks#-(INT(Blocks# / 60) * 60)))),2) ' MARK174 ' DGS091701-DS
Estimate2$ = RIGHT$(SPACE$(5) + STR$(INT(TotBlocks#/60)),5) + ":" + _ ' DGS091701-DS
RIGHT$(STRING$(2,48) + _ ' DGS091701-DS
LTRIM$(STR$(INT(TotBlocks#-(INT(TotBlocks# / 60) * 60)))),2) ' MARK174 ' DGS091701-DS
MBodyTxt$ = ZFG4$ + DFilName$ + _ ' DGS091701-DS
SPACE$(14-LEN(DFilName$)) + _ ' DGS091701-DS
ZFG4$ + STR$(DGSBytesInFile#) + _ ' DGS091701-DS
SPACE$(12-LEN(STR$(DGSBytesInFile#))) + _ ' DGS091701-DS
ZFG4$ + Estimate$ + _ ' MARK174/RM05199301/DGS101603-DS
SPACE$(17-LEN(Estimate$)) + _ ' DGS101603-DS
ZFG4$ + Estimate2$ + ZEmphasizeOff$ ' MARK174/RM05199301/DGS101603-DS/01049401/RM01069401
CALL QuickTPut1 (MBodyTxt$) ' RM01099401
END SUB ' DGS091701-DS
'
SUB MarkFileHeader ' RM01049401
MHedrTxt$ = ZFG1$ + " Approx. Approx. Total" ' DGS091701-DS
CALL QuickTPut1 (MHedrTxt$) ' RM01139403
MHedrTxt$ = ZFG1$ + "FileName Bytes DL Time DL Time " ' DGS091701-DS/RM01139403
CALL QuickTPut1 (MHedrTxt$) ' RM01139403
MHedrTxt$ = ZFG2$ + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + _ ' DGS091701-DS
ZEmphasizeOff$ ' yb040193
CALL QuickTPut1 (MHedrTxt$) ' RM01069401
END SUB ' RM01049401
'
SUB ReportMarked (MarkedList$,ListDesc$) STATIC
CALL FindLast (MarkedList$,ZCarriageReturn$,Temp,ZLastIndex)
CALL QuickTPut1 (ZFG7$ + STR$(ZLastIndex) + " " + ZFG5$ + _
ListDesc$ + "(s) now marked" + ZEmphasizeOff$) ' DGS091701-DS
CALL SkipLine (1) ' RM01179401
ZLastIndex = 0
END SUB
63605 ' AskItems - general routine for asking for a list of items.
' Calling program instructs what the valid commands
' are (ValidCmnd$), what the actual user command is
' (UserCmnd$), and whether to Mark the items. Returns
' list of items in ZUserIn$(). Supports lists for viewing,
' downloading, and marking. Gives option to operate
' on marked when items have been previously marked.
' Calling program tells what to mark (MarkedItems$)
' and how to describe the items gathering (ItemDesc$).
'
SUB AskItems (ValidCmnd$,UserCmnd$,DoMark,ItemDesc$,MarkedItems$,PersonalDnld) ' RM01209401/RM03279401
CALL AllCaps (UserCmnd$)
Temp = INSTR(ValidCmnd$,UserCmnd$)
IF Temp = 0 OR UserCmnd$ = "" THEN _
EXIT SUB
IF UserCmnd$ = "W" THEN _
CALL MarkItems (ZTrue,MarkedItems$,ItemDesc$,PersonalDnld) : _ ' RM01209401
EXIT SUB
Temp = INSTR("VDMU",UserCmnd$) ' BTCH174
ZOutTxt$ = MID$("ViewDnldMarkUpld",4*Temp-3,4) + " what " + ItemDesc$ + "(s)" ' BTCH174
IF Temp = 2 AND ZWildDownOK AND NOT ZPersonalDnld THEN _ ' DD031803/WILD
ZOutTxt$ = ZOutTxt$ + " (WildCard '*' OK)" ' DD030301/WILD
IF Temp < 3 THEN IF MarkedItems$ <> "" THEN _
ZoutTxt$ = ZOutTxt$ + ", M)arked"
ZStackC = ZTrue
CALL PopCmdStack
IF ZWasQ > 0 AND DoMark AND Temp = 3 THEN _
CALL MarkItems (ZTrue,MarkedItems$,ItemDesc$,PersonalDnld) ' RM01209401
END SUB
63610 ' UnMarkItems - takes an input (ZWasZ$), on input item number
' "OnItem", where number of last of the inputs
' is "LastItem", determines whether the option
' is one for marked items, and inserts any marked
' items in MarkedList$ into the input stream (ZUserIn$())
' at the item number (OnItem). Reports
' whether found marked (FoundMarked),
' and if calling programs says to reinitialize
' the marked items (ReInit), empties the
' list of marked items (MarkedList$) when they
' are found.
'
SUB UnMarkItems (MarkedList$,OnItem, LastItem, FoundMarked,ReInit) STATIC
FoundMarked = ZFalse
CALL AllCaps (ZWasZ$)
IF MarkedList$ <> "" THEN IF ZWasZ$ ="M" THEN _
FoundMarked = ZTrue : _
EndFile = LEN (MarkedList$) : _
Temp = INSTR(MarkedList$,ZCarriageReturn$) : _
ZUserIn$(OnItem) = MID$(MarkedList$,1,Temp-1) : _
StartFile = Temp + 1 : _
InsertAt = OnItem + 1 : _
WHILE StartFile < EndFile : _
Temp = INSTR(StartFile,MarkedList$,ZCarriageReturn$) : _
FOR X = LastItem TO InsertAt STEP -1 : _
ZUserIn$(X + 1) = ZUserIn$(X) : _
NEXT : _
LastItem = LastItem + 1 : _
ZUserIn$(InsertAt) = MID$(MarkedList$,StartFile,Temp-StartFile) : _
InsertAt = InsertAt + 1 : _
StartFile = Temp + 1 : _
WEND : _
IF ReInit THEN _
MarkedList$ = ""
END SUB
63615 ' * Sets up next message base link *
SUB NextConf (DoJoin) STATIC
IF ZLinkedConf$ = "" OR (NOT DoJoin) THEN _
EXIT SUB
63616 EndConf = INSTR(ZLinkedConf$,ZCarriageReturn$) ' KG013001
LastConf = (EndConf = LEN(ZLinkedConf$)) ' KG013001
ZHomeConf$ = LEFT$(ZLinkedConf$,EndConf-1)
IF ZNonStop THEN _
CALL QuickTPut1 ("Joining linked conference " + ZHomeConf$) _
ELSE _
ZOutTxt$ = "Continue to linked conference " + ZHomeConf$ + " ([Y],S)kip,A)bort)" : _ ' KG020801
CALL DeLink (ZHomeConf$) : _ ' KG013001
ZTurboKey = -ZTurboKeyUser : _
ZSubParm = 1 : _
CALL TGet : _
IF ZWasQ > 0 AND NOT ZYes THEN _ ' KG020801
ZWasX$ = ZUserIn$(1) : _ ' KG013001
CALL AllCaps (ZWasX$) : _ ' KG013001
ZLinkedConf$ = ZLinkedConf$ + ZHomeConf$ + ZCarriageReturn$ : _ ' KG013001
IF LastConf OR ZWasX$ = "A" THEN _ ' KG013001
ZHomeConf$ = "" : _ ' KG013001 ' KG013001
ZGlobalRead = ZFalse : _ ' KG013001
EXIT SUB _ ' KG013001
ELSE GOTO 63616 ' KG013001
END SUB
63620 ' * Adds/Deletes a new link to conference link list *
SUB AddLink (Conf$) ' RM03309401
IF INSTR(ZCarriageReturn$+ZLinkedConf$,ZCarriageReturn$+Conf$+ZCarriageReturn$) THEN _
EXIT SUB
ZLinkedConf$ = ZLinkedConf$ + Conf$ + ZCarriageReturn$
END SUB
SUB DeLink (Conf$) ' RM03309401
Temp = INSTR(ZCarriageReturn$+ZLinkedConf$,ZCarriageReturn$+Conf$+ZCarriageReturn$)
IF Temp > 0 THEN _
Temp = Temp - 1 : _
ZLinkedConf$ = LEFT$(ZLinkedConf$,Temp) + RIGHT$(ZLinkedConf$,LEN(ZLinkedConf$)-Temp-LEN(Conf$)-1)
END SUB
63625 ' * Sets SysOp security variables Formerly 5370 of rbbs-pc.bas
' * Returns ZWasA true when remote or global sysop
SUB SetSysOp ' RM03309401
ZRemoteSysop = ((ZActiveUserName$ = ZSecretName$) OR _
(ZOrigUserName$ = ZSecretName$))
ZWasA = ZRemoteSysop
ZGlobalSysop = (ZGlobalSysop OR (ZWasA AND ZOrigCnfg$ = ZConfigFileName$))
IF ZGlobalSysop THEN _
ZWasA = ZTrue
END SUB
63630 ' * Sets the user preferences based on user record.
' * Formerly in RBBS-PC.BAS
SUB SetUserPref STATIC
IF ZWasA THEN _
ZUserSecLevel = ZSysopSecLevel _
ELSE ZUserSecLevel = CVI(ZSecLevel$)
ZDropTimes = ASC(ZDropTimes$) ' DROP174
ZBankTime = ASC(ZBankTime$)
ZLastMsgRead = CVI(MID$(ZUserOption$,3,2))
ZUserXferDefault$ = MID$(ZUserOption$,5,1)
IF ZUserXferDefault$ = " " THEN _
ZUserXferDefault$ = "N"
CALL XferType (2,ZTrue)
WasX = ASC(MID$(ZUserOption$,6,1))
ZWasGR = (WasX MOD 3)
ZBoldText$ = CHR$(48 - (WasX > 50))
ZUserTextColor = (WasX - ZWasGR)/3 + 21
IF ZUserTextColor > 37 THEN _
ZUserTextColor = ZUserTextColor - 7
IF ZEmphasizeOff$ <> "" THEN _
CALL QuickTPut (ZColorReset$,0)
IF ZEmphasizeOnDef$ <> "" THEN _
ZEmphasizeOff$ = ZEscape$ + "[" + ZBoldText$ + ";40;" + MID$(STR$(ZUserTextColor),2) + "m" _
ELSE ZEmphasizeOff$ = ""
IF ZWasGR = 1 AND NOT ZEightBit THEN _
ZWasGR = 0
CALL SetGraphic (ZWasGR)
ZRightMargin = CVI(MID$(ZUserOption$,7,2))
IF ZRightMargin > 72 THEN _
ZRightMargin = 72
IF NOT ZConfMode THEN _
ZWasCI$ = ZCityState$ : _
CALL Trim (ZWasCI$)
UserOptions = CVI(MID$(ZUserOption$,9,2))
ZPromptBell = (UserOptions AND 1) > 0
ZExpertUser = (UserOptions AND 2) > 0
CALL SetExpert
ZNulls = (UserOptions AND 4) > 0
ZUpperCase = (UserOptions AND 8) > 0
ZLineFeeds = (UserOptions AND 16) > 0
ZCheckBulletLogon = (UserOptions AND 32) > 0
ZSkipFilesLogon = (UserOptions AND 64) > 0
ZAutoDownDesired = (UserOptions AND 128) > 0
ZReqQuesAnswered = (UserOptions AND 256) > 0
ZMailWaiting = (UserOptions AND 512) > 0
WasX = (UserOptions AND 1024 ) > 0
CALL SetHiLite (NOT WasX)
IF NOT ZHiLiteOff THEN _
CALL QuickTPut (ZEmphasizeOff$,0)
ZTurboKeyUser = (UserOptions AND 2048) > 0
ZTurboKey = ZFalse
ZFileWaiting = (UserOptions AND 4096) > 0
ZAvailableForChat = (UserOptions AND 8192) > 0 ' RCHAT401
CALL SetRegDisplay
ZPageLength = ASC(MID$(ZUserOption$,13,1))
IF ZSubBoard THEN _
GOTO 63632
WasX$ = ZEchoer$
ZEchoer$ = MID$(ZUserOption$,14,1)
IF INSTR("ICR",ZEchoer$) = 0 THEN _
ZEchoer$ = "R"
IF WasX$ <> ZEchoer$ THEN _
CALL ReportEcho
CALL SetEcho (ZEchoer$)
63632 ZNul$ = MID$(STRING$(5,0),1, - 5 * ZNulls)
CALL SetCrLf
ZUseTPut = (ZUpperCase OR ZXOnXOff)
ZPswdSave$ = ZPswd$
END SUB
63635 ' * Reports who is doing echoing. Formerly 9525 of rbbs-pc.bas
SUB ReportEcho ' RM11159302
IF ZEchoer$ = "R" THEN _
ZOutTxt$ = "RBBS now set" _
ELSE IF ZEchoer$ = "C" THEN _
ZOutTxt$ = "Please set your communications package" _
ELSE ZOutTxt$ = "Intermediate host now set"
CALL QuickTPut1 (ZOutTxt$ + " to echo what you type")
END SUB
63640 ' * Welcomes caller on
SUB SayWelcome ' RM03309401
LOCATE 24,1
CALL AMorPM
ZUserLogonTime! = TIMER
ZTimeLoggedOn$ = TIME$
ZLinesPrinted = 0
ZExpertUser = ZFalse
CALL SetExpert
ZOutTxt$ = ""
IF ZMaxNodes > 1 THEN _
ZOutTxt$ = " - Node " + ZNodeID$
ZOutTxt$ = ZOutTxt$ + " - connected at " + ZCBaud$ + " bps" ' RM08229302
IF ZReliableMode THEN _
ZOutTxt$ = ZOutTxt$ + " (Reliable)"
CALL QuickTPut1 ("Welcome to " + ZRBBSName$ + ZOutTxt$)
CALL TestANSI
ZTestParity = ZTrue
ZStopInterrupts = ZTrue
ZFileName$ = ZPreLog$
CALL FlushCom (WasX$)
ZCommPortStack$ = ""
END SUB
63645 ' * computes the session time. Formerly 825 in rbbs-pc.bas
SUB SetSessionTime STATIC
WasX = (ZMaxPerDay - ZMinsPerSession)
WasX = -WasX * (WasX > 0) ' extra from daily max
ZWasQ! = WasX + ZMinsPerSession + (ZMaxPerDay > 0) * ZElapsedTime
IF ZWasQ! > ZMinsPerSession AND ZElapsedTime >= 0 THEN _
ZWasQ! = ZMinsPerSession
ZSecsPerSession! = ZWasQ! * 60 + ZTimeCredits!
END SUB
63650 ' * Sets privileges based on PASSWRDS file
' * Formerly 5135-5160 in RBBS-PC.BAS
SUB SetPrivileges STATIC
ZWasZ$ = ""
CALL SrchPasswrds (Found)
IF NOT Found THEN _
ZTempTimeAllowed = ZMinsPerSessionDef : _
ZTempMaxPerDay = ZMaxPerDayDef : _
ZTempExpiredSec = ZExpiredSec : _
ZMaxBank = ZMaxBankTimeDef _
ELSE ZTimeLockSet = ZTempTimeLock : _
ZDaysInRegPeriod = ZTempRegPeriod : _
ZMaxBank = ZTempMaxBank
ZMinsPerSession = ZTempTimeAllowed
ZMaxPerDay = -(ZMaxPerDay * (ZTempMaxPerDay <= 0)) - _
(ZTempMaxPerDay * (ZTempMaxPerDay > 0))
IF ZLimitMinsPerSession THEN _
IF ZMinsPerSession > ZLimitMinsPerSession THEN _
ZMinsPerSession = ZLimitMinsPerSession : _
ZOutTxt$ = "Time shortened for external event" : _
CALL RingCaller
CALL SetSessionTime
END SUB
63652 ' * Searches file ZPswdFile$, looking for match to
' * ZWasZ$. Returns whether found in "Found" and sets
' * varibles read in by GetPassword
'
SUB SrchPasswrds (Found) STATIC
Found = ZFalse
GOSUB 63665 ' RM01159402
CALL ReadDir (2,1) ' RM01159402
CALL FindLast (ZOutTxt$,",",WhereFound,NumFinds) ' RM01159402
NumFinds = NumFinds + 1 ' RM01159402
CLOSE 2 ' RM01159402
GOSUB 63665 ' RM01159402
MatchPass$ = ZWasZ$
IF MatchPass$ <> "" THEN _
MatchPass$ = LEFT$(MatchPass$ + SPACE$(15),15)
MatchPass = (MatchPass$ <> "")
63654 IF EOF(2) THEN _
GOTO 63659
63656 CALL GetPassword (NumFinds) ' RM01159402
IF ZErrCode <> 0 THEN _
CALL UpdtCalr (ZPswdFile$ + " bad format!",2) : _
GOTO 63659
IF MatchPass THEN _
ZTempPassword$ = LEFT$(ZTempPassword$ + SPACE$(15),15) : _
IF MatchPass$ <> ZTempPassword$ THEN _
GOTO 63654 _
ELSE IF ZUserSecLevel >= ZMinSecForTempPswd THEN _
GOTO 63658 _
ELSE GOTO 63654
IF ZUserSecLevel <> ZTempSecLevel OR ZTempPassword$ <> "" THEN _
GOTO 63654
IF ZStartTime = 0 THEN _
GOTO 63658
WorkTime$ = TIME$
TestTime = VAL(LEFT$(WorkTime$,2) + MID$(WorkTime$,4,2))
IF TestTime => ZStartTime AND TestTime <= ZEndTime THEN _
GOTO 63658
IF ZEndTime < ZStartTime THEN _
IF TestTime => ZStartTime OR TestTime <= ZEndTime THEN _
GOTO 63658
GOTO 63654
63658 Found = ZTrue
63659 ZErrCode = 0
IF ZTempMaxBank > 255 THEN _ ' RM030801
ZTempMaxBank = 255 ' RM030801
IF ZDropCarSecChng > 255 THEN _ ' RM030801
ZDropCarSecChng = 255 ' RM030801
EXIT SUB ' RM01159402
63665 CALL OpenWork (2,ZPswdFile$) ' RM01159402
IF ZErrCode > 0 THEN _ ' RM01159402
CALL UpdtCalr ("Err"+STR$(ZErrCode)+" opening " + ZPswdFile$,2) : _ ' RM01159402
GOTO 63659 ' RM01159402
RETURN ' RM01159402
END SUB
63675 SUB SetUserUpDn STATIC
ZDnlds = CVI(ZUserDnlds$)
ZUplds = CVI(ZUserUplds$)
ZDropTimes = ASC(ZDropTimes$) ' DROP174
ZBankTime = ASC(ZBankTime$)
IF ZEnforceRatios THEN _
ZDLToday! = CVS(ZTodayDl$) : _
ZBytesToday! = CVS(ZTodayBytes$) : _
ZDLBytes! = CVS(ZDlBytes$) : _
ZULBytes! = CVS(ZULBytes$)
END SUB
SUB SetGlobalUpDn STATIC
IF NOT ZGlobalsSet THEN _
ZGlobalsSet = ZTrue : _
ZGlobalDnlds = ZDnlds : _
ZGlobalUplds = ZUplds : _
ZGlobalDLToday! = ZDLToday! : _
ZGlobalBytesToday! = ZBytesToday! : _
ZGlobalDLBytes! = ZDLBytes! : _
ZGlobalULBytes! = ZULBytes! : _
ZGlobalDropTimes = ZDropTimes : _ ' DROP174
ZGlobalBankTime = ZBankTime
END SUB
63700 ' $SUBTITLE: 'TestANSI - test caller for ANSI support'
' $PAGE
'
' NAME -- TestANSI
' MEANING
' INPUTS -- ZTestANSITime # of seconds to wait for ANSI response
' 0 = do not test for ANSI
'
' OUTPUTS -- ZANSITest = True if ANSI Detected ' CHAT174/RM030101
'
' PURPOSE -- Test callers' software for support of ANSI graphics
'
SUB TestANSI ' RM11159302
IF ZTestANSITime < 1 THEN _
GOTO 63705
IF ZLocalUser THEN _
IF ZDOSAnsi THEN _
GOTO 63710 _
ELSE GOTO 63705
CALL SkipLine (1) ' RM10049301
CALL QuickTPut1 ("Testing GRAPHICS.... Please Wait...") ' DGS051401-TH/RM10029302
CALL SkipLine (1) ' RM10049301
CALL FlushCom(Temp$)
CALL PutCom (ZEscape$ + "[6n")
CALL DelayTime(ZTestANSITime)
CALL WipeLine (5)
CALL FlushCom(Temp$)
CALL WipeLine (5)
Temp = INSTR(Temp$,ZEscape$ + "[")
IF Temp > 0 THEN _
Temp = INSTR(Temp,Temp$,"R") : _
IF TEMP > 0 AND TEMP < 9 THEN _
GOTO 63710
63705 ZHiLiteOff = ZTrue
CALL SetGraphic (0)
EXIT SUB
63710 CALL FlushCom (Temp$) ' DD061401
CALL PutCom (ZEscape$ + "[!" + CHR$(8)) ' DD061401/CM012394
CALL DelayTime (ZTestANSITime) ' DD061401
CALL WipeLine (5) ' DD061401
CALL FlushCom (Temp$) ' DD061401
CALL WipeLine (5) ' DD061401
Temp = INSTR(Temp$,"RIPSCRIP") ' DD061401
IF Temp THEN ' DD061401
CALL QuickTPut1 ("RIP detected!") ' DD061401
ZRIPTest = ZTrue ' RM07139301
ELSE ' DD061401
CALL QuickTPut1 ("ANSI detected!") ' DD061401
END IF ' DD061401
CALL SetGraphic(2) ' RM07159301
ZHiLiteOff = ZFalse
ZANSITest = ZTrue ' CHAT174/RM030101
END SUB
63715 ' Counts the number of words NumFound in ParseThis, defined
' as strings separated by those in ExcludeThis$
'
SUB ExcludeCount (ExcludeThis$, ParseThis$, NumFound) STATIC
NumFound = 0
StartAt = 1
FOR I = 1 TO LEN(ParseThis$)
IF INSTR(ExcludeThis$, MID$(ParseThis$, I, 1)) > 0 THEN _
ParseLen = I - StartAt : _
IF ParseLen > 0 THEN _
NumFound = NumFound + 1
NEXT
END SUB
63720 SUB AraAllCaps (Ara$(1),WhichElement) ' RM03309401
Temp$ = Ara$(WhichElement)
CALL AllCaps (Temp$)
Ara$(WhichElement) = Temp$
END SUB
'
63750 ' $SUBTITLE: 'GetFastFile - Sets the Fast File Tabs List'
' $PAGE
'
' NAME -- GetFastFile
' MEANING
' INPUTS -- ZFastFileList$ The FIDX file
' ZFastFileLocator$ The LIDX file
'
' OUTPUTS -- ZFastTabs$ The Fast File Tabs string
' ZFastFileSearch Set true if fast file system in use
'
' PURPOSE -- Sees if the tabs file for the fast file is present, and
' loads it's contants if found. Originally in RBBS-PC.BAS
'
SUB GetFastFile
CALL FindFile (ZFastFileList$,ZOK)
IF ZOK THEN _
CALL FindFile (ZFastFileLocator$,ZOK) : _
IF ZOK THEN _
ZFastFileSearch = ZTrue : _
CALL BreakFileName (ZFastFileList$,Drive$,WasX$,ZWasY$,ZTrue) : _
ZFileName$ = Drive$ + WasX$ + "T" + ZWasY$ : _
CALL FindFile (ZFileName$,ZOK) : _
ZErrCode = 0 : _
IF ZOK THEN _
FilNum = FREEFILE : _
CALL OpenRand2 (ZFileName$,160,FilNum) : _ ' TAB174/RM04029401
FIELD FilNum, 160 AS IndexRec$ : _ ' TAB174/RM070693
GET FilNum, 1 : _
ZFastTabs$ = IndexRec$ : _
CLOSE FilNum _
ELSE ZFastTabs$ = ""
END SUB
'
63800 ' $SUBTITLE: 'SelectCD - Select Which CD to display'
' $PAGE
'
' NAME -- SelectCD
' MEANING
' INPUTS -- WhichDisk 1 - select CD Disk default
' 2 - select CD Disk (user)
' 3 - reset system defaults
'
' OUTPUTS --
'
'
'
'
'
'
'
' PURPOSE -- Select from a list of CD-ROM disks and set up system for
' display of list and download of files.
'
' WRITTEN BY: Richie Molinelli - 03/26/94
'
SUB SelectCD (WhichDisk)
ON WhichDisk GOTO 63801,63801,63830
63801 CDCnfgFile$ = ZNodeWorkDrvPath$ + "CDR" + ZNodeID$ + ".CFG"
CALL FindFile (CDCnfgFile$,Found)
IF NOT Found THEN _
EXIT SUB
ZAbort = ZFalse
FilNum = FREEFILE
CALL OpenWork (FilNum,CDCnfgFile$)
X = 0
Temp = UBOUND(ZOutTxt$)
DO WHILE NOT EOF(FilNum)
X = X + 1
LINE INPUT #FilNum,ZOutTxt$
IF Temp < X THEN
IF FRE(ZOutTxt$(1)) > 4096 THEN
REDIM PRESERVE ZOutTxt$(X)
ELSE
CALL Lprnt ("Too many disks for available memory!",1)
CALL UpdtCalr ("Too many CD-Disks listed for avail. memory",1)
EXIT DO
END IF
END IF
ZOutTxt$(X) = ZOutTxt$
LOOP
CLOSE FilNum
IF WhichDisk = 1 THEN _
Y = 1 : _
GOTO 63820
63810 CALL SkipLine (1)
FOR Y = 1 to X
CALL QuickTPut1 (ZFG7$ + STR$(Y) + SPACE$(4 - LEN(STR$(Y))) + ZFG3$ + _
MID$(MID$(ZOutTxt$(Y),1,INSTR(ZOutTxt$(Y),",") - 1),1,ZRightMargin - 4) + ZEmphasizeOff$)
CALL AskMore ("",ZTrue,ZTrue,WasX,ZTrue)
NEXT
CALL SkipLine (1)
ZOutTxt$ = "List which CD-ROM [ENTER] = Quit"
ZTurboKey = -ZTurboKeyUser
ZStackC = ZFalse
CALL PopCmdStack
IF ZSubParm = -1 THEN _
GOTO 63827
IF ZWasQ = 0 THEN _
ZAbort = ZTrue : _
GOTO 63827
IF VAL(ZUserIn$(ZAnsIndex)) < 1 OR VAL(ZUserIn$(ZAnsIndex)) > X THEN _
CALL QuickTPut1 (ZEmphasizeOn$ + "Ivalid choice. Must be 1 - " + LTRIM$(STR$(X)) + ZEmphasizeOff$) : _
GOTO 63810
Y = VAL(ZUserIn$(ZAnsIndex))
63820 CALL AllCaps (ZOutTxt$(Y))
X = INSTR(ZOutTxt$(Y),",")
Z = INSTR(X + 1,ZOutTxt$(Y),",")
Temp$ = MID$(ZOutTxt$(Y),X + 1,Z - (X+ 1))
CALL BreakFileName (Temp$,DR$,Pre$,Ext$,ZTrue)
ZLibDir$ = Temp$
ZLibDirPath$ = DR$
ZCurDirPath$ = DR$
X = INSTR(Z + 1,ZOutTxt$(Y),",")
Temp$ = MID$(ZOutTxt$(Y),Z + 1,X - (Z + 1))
ZDirPrefix$ = MID$(Temp$,1,INSTR(Temp$,".") - 1)
ZLibDirExtension$ = MID$(Temp$,INSTR(Temp$,".") + 1)
Z = INSTR(X + 1,ZOutTxt$(Y),",")
ZDirCatFile$ = DR$ + MID$(ZOutTxt$(Y),X + 1,Z - (X + 1))
X = INSTR(Z + 1,ZOutTxt$(Y),",")
ZFastFileList$ = DR$ + MID$(ZOutTxt$(Y),Z + 1,X - (Z + 1))
Z = INSTR(X + 1,ZOutTxt$(Y),",")
ZFastFileLocator$ = DR$ + MID$(ZOutTxt$(Y),X + 1,Z - (X + 1))
ZLibDrive$ = MID$(ZOutTxt$(Y),Z + 1,1)
X = INSTR(Z + 1,ZOutTxt$(Y),",")
ZUseCDWorkDrive = (UCASE$(MID$(ZOutTxt$(Y),X + 1)) <> "N")
Z = INSTR(X + 1,ZOutTxt$(Y),",")
ZCDMultiChanger = (UCASE$(MID$(ZOutTxt$(Y),Z + 1,1)) = "Y")
IF ZCDMultiChanger THEN _
ZLibDrive$ = ""
CALL GetFastFile
63827 REDIM ZOutTxt$(Temp)
EXIT SUB
63830 ZLibDir$ = ZLibDirSave$
ZLibDirPath$ = ZLibDirPathSave$
ZDirPrefix$ = ZDirPrefixSave$
ZCurDirPath$ = ZCurDirPathSave$
ZLibDirExtension$ = ZLibDirExtensionSave$
ZDirCatFile$ = ZDirCatFileSave$
ZLibDrive$ = ZLibDriveSave$
ZUseCDWorkDrive = ZFalse
ZCDMultiChanger = ZFalse
IF ZFastFileList$ <> ZFastFileListSave$ THEN
ZFastFileList$ = ZFastFileListSave$
ZFastFileLocator$ = ZFastFileLocatorSave$
CALL GetFastFile
END IF
END SUB