home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / CDOR0811.ZIP / CDORMRGS.ZIP / RSB5CDOR.MRG < prev   
Encoding:
Text File  |  1993-08-11  |  174.8 KB  |  3,387 lines

  1. * ------------[ BLED merge (c) Ken Goosens ]-------------
  2. * Merge this against RBBSSUB5.BAS to produce RBBSSUB5.NEW
  3. * RBBSSUB5.BAS:  Date 6-20-92  Size 116575 bytes
  4. * ------------[ Created 08-11-1993 19:36:46 ]------------
  5. * REPLACING old line(s) by new
  6. * ------[ first line different ]------
  7. '' $segment
  8. ' $linesize:132
  9. ' $title: 'RBBSSUB5.BAS 17.4, Copyright 1986 - 92 by D. Thomas Mack'
  10. '  Copyright 1991 by D. Thomas Mack, all rights reserved.
  11. '  Name ...............: RBBSSUB5.BAS
  12. '  First Released .....: June 21, 1992
  13. '  Subsequent Releases.: 
  14. '  Copyright ..........: 1986 - 1992
  15. '  Purpose.............: The Remote Bulletin Board System for the IBM PC,
  16. '     RBBS-PC.BAS utilizes a lot of common subroutines.  Those that do not
  17. '     require error trapping are incorporated within RBBSSUB 2-5 as
  18. '     separately callable subroutines in order to free up as much
  19. '     code as possible within the 64K code segment used by RBBS-PC.BAS.
  20. '  Parameters..........: Most parameters are passed via a COMMON statement.
  21. '
  22. ' Subroutine  Line               Function of Subroutine
  23. '   Name     Number
  24. '  AddLink        63620  Adds a conference link
  25. '  AraAllCaps     63720  Capitalize an elment of an array
  26. '  AskItems       63610  Get an list of items
  27. '  BinSearch      63520  Binary searches sorted file for a key value
  28. '  BreakFileName  63300  Break file name into component parts
  29. '  BufAsUnit      63500  Buffer out a string with CR's
  30. '  ChangeInit     63590  Get an integer value                        ' KG01802
  31. '  ChkAddedTime   63056  Check whether ok to extend time remaining   ' SK01601
  32. '  ChkIfMsgHeader 63550  Checks whether record is a msg header
  33. '  DeLink         63620  Removes conference from linked ones
  34. '  DoorReturn     63100  Process door requests
  35. '  ExcludeCount   63715  Counts # of words in a string
  36. '  FdMacExe       63462  Executes a found macro
  37. '  FileSystem     20117  File System for RBBS-PC
  38. '  FindIt         63490  Check whether file exists and if so open as #2
  39. '  FormRead       63420  Read from file into a form
  40. '  LockAppend     63400  Prepare for a file append
  41. '  MacroExe       63460  Execute internal macro rather than user
  42. '  MarkItems      63600  Convert list of items into a "mark"
  43. '  MsgNameMatch   63540  Match name to one in msg header
  44. '  NextConf       63615  Sets up join to next conference link
  45. '  NoPath         63480  Detects whether string has a path in it
  46. '  RestoreCom     63310  Restore comm port after external program
  47. '  ReadMacro      63330  Read and process macro
  48. '  ReadParms      63490  Read certain number of parameters from file 2
  49. '  ReportEcho     63635  Reports echo preference of caller
  50. '  SayWelcome     63640  Welcomes callers on logon
  51. '  SetPrivileges  63650  Sets user privileges based on PASSWRDS
  52. '  SetPrompt      63470  Set prompts based on the user's security
  53. '  SetSessionTime 63645  Sets the session time
  54. '  SetSysOp       63625  Determines whether remote or global SysOp
  55. '  SetUserFlag    63560  Sets specified user flag
  56. '  SetUserPref    63630  Sets user preferences based on user record
  57. '  ShellExit      63320  Exit RBBS via shell
  58. '  SrchPasswrds   63652  Searches the PASSWRDS file
  59. '  TakeOffHook    63530  Take modem off hook
  60. '  TestANSI       63700  Tests caller for ANSI compatibility
  61. '  TStats         69600  Display transfer stats from XFER-? file     ' MplXfer
  62. '  UnLockAppend   63410  Clean up after file append
  63. '  UnMarkItems    63610  Convert marked items into an input list
  64. '  VerifyAns      63510  Verify that string passes edits
  65. '  WildCard       63200  Match string to a pattern
  66. '
  67. '  $INCLUDE: 'RBBS-VAR.BAS'
  68. '
  69. * REPLACING old line(s) by new
  70. 20117 ' $SUBTITLE: 'FileSystem -- subroutine for RBBS-PC's file system'
  71. ' $PAGE
  72. '
  73. ' NAME    -- FileSystem
  74. '
  75. ' INPUTS  --       PARAMETER                 MEANING
  76. '             ZFileSysParm = 1  LIST THE SYSOP'S COMMENTS FILE
  77. '                                 2  L)IST DIRECTORY COMMAND
  78. '                                 3  D)OWNLOAD COMMAND
  79. '                                 4  RETURN FROM EXTERNAL PROTOCOLS
  80. '                                 5  U)PLOAD COMMAND
  81. '                                 6  S)CAN DIRECTORY COMMAND
  82. '                                 7  P)ERSONAL FILES COMMAND
  83. '                                 8  N)EW FILES COMMAND
  84. '                                 9  RETURN FROM EXTENDED DESCRIPTION
  85. * ------[ first line different ]------
  86. '                                 10  Batch Upload files             ' Mpl090202
  87. '
  88. ' OUTPUTS -- ZFileSysParm = 1  COMMAND PROCESSED SUCCESSFULLY
  89. '                                2  RECYCLE TO TOP OF RBBS-PC (202)
  90. '                                3  PROCESS NEXT COMMAND (1200)
  91. '                                4  DENY USER ACCESS (1380)
  92. '                                5  HANDLE EXTENDED DESCRIP. (2008)
  93. '                                6  USER'S TIME EXCEEDED (10553)
  94. '                                7  Carrier DROPPED (10595)
  95. '
  96. ' PURPOSE -- To handle the RBBS-PC file system commands
  97. '
  98.       SUB FileSystem STATIC
  99.       ZFF = ZFileSysParm
  100.       ZFileSysParm = 1
  101.       CALL SaveUserActivity(CHR$(70), ZNodeRecIndex, ZFalse)         ' DD021301/RCHAT
  102.       ZActiveFMSDir$ = ""
  103.       ON ZFF GOSUB 20119, _  ' HANDLER TO LIST COMMENTS TO SYSOP
  104.                   20150, _  ' L)IST DIRECTORY COMMAND HANDLER
  105.                   20180, _  ' D)OWNLOAD COMMAND HANDLER
  106.                   20263, _  ' RETURN FROM EXTERNAL Protocol'S
  107.                   20400, _  ' U)PLOAD COMMAND HANDLER
  108.                   21800, _  ' S)CAN DIRECTORY COMMAND HANDLER
  109.                   21850, _  ' P)ERSONAL FILES COMMAND HANDLER
  110.                   21860, _  ' N)EW FILES COMMAND HANDLER
  111.                   20705, _  ' RETURN FROM EXTENDED DESCRIPTIONS      ' Mpl090202
  112.                   20410     ' Batch Upload files                     ' DD090202
  113.       GOTO 21920
  114. * REPLACING old line(s) by new
  115. 20126 CALL ReadDir (2,1)
  116.       IF ZErrCode <> 0 THEN _
  117.          ZWasEL = 20126 : _
  118.          GOTO 21900
  119. * ------[ first line different ]------
  120.       IF LEFT$(ZOutTxt$,1) = SPACE$(1) THEN _                        ' DD021301
  121.          IF LastOK AND NOT ZExtendedOff THEN _
  122.             GOTO 20140 _
  123.          ELSE GOTO 20124
  124.       IF WasCK = 0 THEN _
  125.          GOTO 20140
  126.       LastOK = ZFalse
  127. * REPLACING old line(s) by new
  128. 20128 IF ZJumpSearching THEN _
  129.          GOTO 20129
  130.       IF WasCK < 2 THEN _
  131.          GOTO 20130
  132.       IF WildSearch THEN _
  133. * ------[ first line different ]------
  134.          ZWasA = INSTR(ZOutTxt$,SPACE$(1)) : _                       ' DD021301
  135.          IF ZWasA = 0 THEN _
  136.             GOTO 20124 _
  137.          ELSE ZWasZ$ = LEFT$(ZOutTxt$,ZWasA - 1) : _
  138.               CALL WildFile (WasRS$,ZWasZ$,WasXXX) : _
  139.               WasXXX = NOT WasXXX : _
  140.               GOTO 20136
  141. * REPLACING old line(s) by new
  142. * ------[ first line different ]------
  143. 20130 ZWasA = INSTR(9,MID$(ZOutTxt$,1,32),CHR$(47))                  ' DD021301
  144.       IF ZWasA = 0 THEN _
  145.          ZWasA = INSTR(9,MID$(ZOutTxt$,1,32),CHR$(45))               ' DD021301
  146. * REPLACING old line(s) by new
  147. 20132 IF ZWasA < 3 THEN _
  148.          GOTO 20124
  149.       IF INSTR("0123456789",MID$(ZOutTxt$,ZWasA - 1,1)) = 0 THEN _
  150.          GOTO 20124
  151.       ZWasA = ZWasA - 2
  152.       WasWK$ = RIGHT$(MID$(ZOutTxt$,ZWasA,8),2) + _
  153.             LEFT$(MID$(ZOutTxt$,ZWasA,8),2) + _
  154.             MID$(MID$(ZOutTxt$,ZWasA,8),4,2)
  155. * ------[ first line different ]------
  156.       IF MID$(WasWK$,3,1) = SPACE$(1) THEN _                         ' DD021301
  157.          MID$(WasWK$,3,1) = CHR$(48)                                 ' DD021301
  158.       IF MID$(WasWK$,5,1) = SPACE$(1) THEN _                         ' DD021301
  159.          MID$(WasWK$,5,1) = CHR$(48)                                 ' DD021301
  160. * REPLACING old line(s) by new
  161. 20140 LastOK = ZTrue
  162.       GOSUB 21650
  163.       IF ZFileSysParm > 1 THEN _
  164.          RETURN
  165.       IF ZLinesPrinted > MaxPrint THEN _
  166.          ZTurboKey = -ZTurboKeyUser : _
  167.          CALL AskMore (",M)ark",ZTrue,ZTrue,ZAnsIndex,ZFalse) : _
  168.          IF ZNo THEN _
  169.             ZErrCode = 0 : _
  170.             RETURN _
  171.          ELSE Temp$ = ZUserIn$(1) : _
  172. * ------[ first line different ]------
  173.               CALL AskItems (CHR$(77),Temp$,ZTrue,"file",ZMarkedFiles$) : _ ' DD021301
  174.               ZUserIn$(1) = ""
  175.       IF ZJumpSearching THEN _
  176.          IF LEFT$(ZOutTxt$,1) <> SPACE$(1) THEN _                    ' DD021301
  177.             PrevSearch$ = WasRS$ : _
  178.             PrevCK = WasCK : _
  179.             WasCK = 2 : _
  180.             WasRS$ = ZJumpTo$
  181.       IF NOT ZRet THEN _
  182.          GOTO 20124
  183. * REPLACING old line(s) by new
  184. 20150 ZListDir = ZTrue
  185.       ListNew = ZFalse
  186.       SearchDate$ = ""
  187.       SearchString$ = ""
  188.       WasRS$ = ""
  189.       ShowDirOfDir = (ZLastIndex <= ZAnsIndex) AND NOT ZExpertUser
  190.       WasCK = 0
  191.       ZSearchingAll = ZFalse
  192. * ------[ first line different ]------
  193. '     ZExtendedOff = ZFalse                                          ' DD062901
  194. * REPLACING old line(s) by new
  195. * ------[ first line different ]------
  196. 20155 IF ZDnldCompleted AND ZAutoEnd = 1 THEN _                      'Pe 02/05/90
  197.          ZFileSysParm = 7 : _                                        ' Mpl090202
  198.          RETURN                                                      ' Mpl090202
  199.       IF ListNew OR ZAnsIndex > 255 THEN _
  200.          RETURN
  201.       CALL GetDirs (NOT ZExpertUser)                                 ' DD061401
  202.       IF ZWasQ = 0 THEN _
  203.          RETURN
  204.       ShowDirOfDir = ZFalse
  205.       CALL ConvertDir (ZAnsIndex)
  206.       WasQX = ZLastIndex
  207. * REPLACING old line(s) by new
  208. 20159 IF ZAnsIndex < ZLastIndex THEN _
  209.          GOTO 20155
  210.       ZSearchingAll = ZFalse
  211.       CALL CmdStackPushPop (1)
  212.       ZLastIndex = 0
  213.       IF ZNo OR InFMS OR (ZFileNameHold$ = ZDirPrefix$) THEN _
  214.          GOTO 20155
  215. * ------[ first line different ]------
  216.       GOSUB 20177                                                    ' DD030301/WILD
  217.       CALL QuickTPut (ZEmphasizeOff$,1)                              ' DD052301
  218.       ZTurboKey = - ZTurboKeyUser
  219.       ZOutTxt$ = ZFG2$ + CHR$(45) + ZFG3$ + CHR$(61) + ZFGE$ + "End list" + _  ' DD021301
  220.                 ZFG3$ + CHR$(61) + ZFG2$ + CHR$(45) + ZEmphasizeOff$ + _       ' DD021301
  221.                 ZCrLf$ + "L)ist again, T)ype, V)iew, M)ark, D)nld, [Q]uit" ' DD060101
  222.       GOSUB 21667
  223.       CALL AraAllCaps (ZUserIn$(),1)
  224.       IF ZUserIn$(1) = CHR$(84)  AND _                          'T   ' DD021301
  225.          ZUserSecLevel >= ZOptSec(19 - 20 * (ZMenuIndex = 6)) THEN _ ' Mpl090202
  226.          ZAnsIndex = 1 : _                                           ' Mpl090202
  227.          CALL TypeFile : _                                           ' Mpl090202
  228.          RETURN                                                      ' Mpl090202
  229.       IF ZUserIn$(1) = CHR$(86)  AND _                          'V   ' DD021301
  230.          ZUserSecLevel >= ZOptSec(19 - 20 * (ZMenuIndex = 6)) THEN _ ' Mpl090202
  231.          ZAnsIndex = 1 : _                                           ' Mpl090202
  232.          CALL GetArc : _                                             ' Mpl090202
  233.          CALL Line25 : _                                             ' DD090601
  234.         RETURN                                                       ' Mpl090202
  235.       IF ZUserIn$(1) = CHR$(76) THEN _                          'L   ' DD021301
  236.          ZUserIn$(ZAnsIndex) = WasA1$ : _
  237.          GOTO 20161
  238.       Temp$ = ZUserIn$(1)
  239.       Temp = (ZUserIn$(1) = CHR$(68))                           'D   ' DD021301
  240.       CALL AskItems ("MD",Temp$,ZTrue,"file",ZMarkedFiles$)
  241.       IF ZWasQ = 0 OR ZUserSecLevel < ZOptSec(19 - 20 * (ZMenuIndex = 6)) THEN _
  242.          GOTO 20160
  243.       IF Temp THEN _
  244.          GOSUB 20202 _
  245.       ELSE IF LEN(ZUserIn$(1)) > 1 THEN _
  246.          ZAnsIndex = 1 : _
  247.          GOSUB 20202
  248. * REPLACING old line(s) by new
  249. * ------[ first line different ]------
  250. 20161 IF INSTR(ZUserIn$(ZAnsIndex),CHR$(46)) THEN _                  ' DD021301
  251.          GOTO 20172
  252.       ZViolation$ = "List Dir. "
  253.       ZWasZ$ = ZUserIn$(ZAnsIndex)
  254.       ZWasA = INSTR("E+E-E",ZWasZ$)
  255.       IF ZWasA > 0 THEN _
  256.          IF ZWasA = 5 THEN _
  257.             ZExtendedOff = NOT ZExtendedOff : _
  258.             GOTO 20155 _
  259.          ELSE ZExtendedOff = (ZWasA > 2) : _
  260.               GOTO 20155
  261.       CALL AllCaps(ZWasZ$)
  262.       ZFileNameHold$ = ZWasZ$
  263.       WasA1$ = ZWasZ$
  264.       IF ZWasZ$ = ZDirPrefix$ THEN _
  265.          GOTO 20164
  266.       InFMS = ZFalse
  267. * REPLACING old line(s) by new
  268. 20162 CALL CmdStackPushPop (1)         ' save dir list list processing
  269.       CALL FMS (ZWasZ$,SearchString$,SearchDate$,InFMS, _
  270.                 ZCategoryName$(),ZCategoryCode$(),ZCategoryDesc$(),_
  271.                 DnldFlag,CatFound,ZAnsIndex)
  272.       WHILE DnldFlag > 0 AND ZSubParm > -1
  273.          GOSUB 20202
  274.          IF ZFileSysParm > 1 THEN _
  275.             RETURN
  276. * ------[ first line different ]------
  277.          IF ZDnldCompleted and ZAutoEnd = 1 THEN _                   'Pe 02/05/90
  278.             RETURN                                                   ' AUTOLOGOFF MOD
  279.          WasX$ = ZCategoryCode$(CatFound)
  280.          CALL DispUpDir (WasX$,SearchString$,SearchDate$,DnldFlag,ZAnsIndex)
  281.          CALL CheckTimeRemain (MinsRemaining)
  282.          IF ZSubParm = -1 THEN _
  283.             ZFileSysParm = 6 : _
  284.             RETURN
  285.          CALL Carrier
  286.       WEND
  287.       IF ZSubParm = -1 THEN _
  288.          ZFileSysParm = 7 : _
  289.          RETURN
  290.       IF ZAnsIndex > 255 OR ZRet THEN _
  291.          ZLastIndex = 0 : _
  292.          RETURN
  293.       CALL CmdStackPushPop (2)        ' restore dir list list processing
  294.       ZActiveFMSDir$ = ""
  295.       IF InFMS THEN _
  296.          GOTO 20159
  297.       IF ZUserSecLevel < ZMinSecToView THEN _
  298.          IF ZFileNameHold$ = ZUpldDirCheck$ THEN _
  299.             ZOutTxt$ = "Upload Directory Available " + _             ' DD062304
  300.                  "to SYSOP Only" : _                                 'DGS-TXT
  301.             GOSUB 21640 : _                                          'DGS-TXT
  302.             ZNo = ZTrue : _                                          'DGS-TXT
  303.             GOTO 20155                                               'DGS-TXT
  304.       ZFileNameHold$ = ZUserIn$(ZAnsIndex)
  305.       IF ZLimitSearchToFMS THEN _
  306.          GOTO 20166
  307.       IF NOT ZSearchingAll THEN _
  308.          IF ZFileNameHold$ = "ALL" OR ZFileNameHold$ = CHR$(65) THEN _ ' DD021301
  309.             ZSearchingAll = ZTrue : _
  310.             GOSUB 21890 : _
  311.             GOTO 20157
  312.       CALL BadFile (ZFileNameHold$,BadFileNameIndex)
  313.       ON BadFileNameIndex GOTO 20163,20172,20176
  314. * REPLACING old line(s) by new
  315. 20164 IF ZFileName$ = ZUpldDirCheck$ AND _
  316.          ZUserSecLevel >= ZMinSecToView THEN _
  317.             ZFileName$ = ZUpldPath$ _
  318.       ELSE ZFileName$ = ZCurDirPath$
  319.       ZFileName$ = ZFileName$ + _
  320.                    ZFileNameHold$ + _
  321. * ------[ first line different ]------
  322.                    CHR$(46) + _                                      ' DD021301
  323.                    ZDirExtension$
  324.       CALL Graphic (ZFileName$)
  325. * REPLACING old line(s) by new
  326. 20166 ZFileName$ = ZCurDirPath$ + _
  327.                    ZFileNameHold$ + ".MNU"
  328. * ------[ first line different ]------
  329.       CALL FindIt (ZFileName$)                                       ' Mpl090202
  330.       IF ZOK THEN _
  331.          CALL BufFile (ZFileName$,ZAnsIndex) : _
  332.          GOTO 20155
  333.       IF ZAltdirExtension$ = "" THEN _
  334.          GOTO 20172
  335.       ZFileName$ = ZCurDirPath$ + _
  336.                    ZFileNameHold$ + _
  337.                    CHR$(46) + _                                      ' DD021301
  338.                    ZAltdirExtension$
  339.       CALL Graphic (ZFileName$)
  340.       IF NOT ZOK THEN _
  341.          GOTO 20172
  342. * INSERTING new line(s)
  343. 20177 ZListOnly = ZFalse                                             ' DD030301/WILD
  344.       ZExtraDnldTime = 0
  345.       ZFreeDnld = ZFalse
  346.       ZPersonalDnld = ZFalse
  347.       RETURN
  348. '                                                                    ' DD030301/WILD
  349. ' * WildCard Download Support                                        ' DD030301/WILD
  350. '                                                                    ' DD030301/WILD
  351. * REPLACING old line(s) by new
  352. * ------[ first line different ]------
  353. 20178 ZOutTxt$ = "Mark Files to Download" + ZYesPrompt$              ' DD030301/WILD
  354.       ZTurboKey = - ZTurboKeyUser                                    ' DD030301/WILD
  355.       GOSUB 21668                                                    ' DD030301/WILD
  356.       IF ZNO THEN _                                                  ' DD030301/WILD
  357.          CALL KillWork (ZNodeWorkDrvPath$+"WILDDOWN.DEF") : _        ' PE031302/WILD
  358.          GOTO 20180                                                  ' DD030301/WILD
  359.       CALL OpenWork (2,ZNodeWorkDrvPath$+"WILDDOWN.DEF")             ' DD030301/WILD
  360.       DO WHILE NOT EOF(2)                                            ' DD030301/WILD
  361.          CALL ReadDir (2,1)                                          ' DD030301/WILD
  362.          CALL Trim (ZOutTxt$)                                        ' DD030301/WILD
  363.          ZFileName$ = ZOutTxt$                                       ' DD030301/WILD
  364.          IF ZFileName$ = "" THEN EXIT DO                             ' DD030301/WILD
  365.          ZOutTxt$ = "Mark " + ZFileName$ + _                         ' DD030301/WILD
  366.                     SPACE$(13-LEN(ZFileName$)) + _                   ' DD030301/WILD
  367.                     "(Y)es,[N]o,A)bort)"                             ' DD030301/WILD
  368.          ZTurboKey = - ZTurboKeyUser                                 ' DD030301/WILD
  369.          GOSUB 21668                                                 ' DD030301/WILD
  370.          IF LEFT$(UCASE$(ZUserIn$),1) = CHR$(65) THEN _              ' DD030301/WILD
  371.             GOTO 20179                                               ' DD030301/WILD
  372.          IF ZYes THEN                                                ' DD032301
  373.             IF ZMarkedFiles$ = "" THEN                               ' DD032301
  374.                ZMarkedFiles$ = ZFileName$ + CHR$(13)                 ' DD032301
  375.             ELSE                                                     ' DD032301
  376.                IF INSTR(ZMarkedFiles$,ZFileName$) = 0 THEN           ' DD032301
  377.                   ZMarkedFiles$ = ZMarkedFiles$ + ZFileName$ + CHR$(13) ' DD030301/WILD
  378.                END IF                                                ' DD032301
  379.             END IF                                                   ' DD032301
  380.          END IF                                                      ' DD032301
  381.       LOOP                                                           ' DD030301/WILD
  382.       CLOSE 2                                                        ' DD030301/WILD
  383.       CALL QuickTPut1 (ZFG2$ + CHR$(45) + ZFG3$ + CHR$(61) + _       ' DD032601
  384.                        ZFGE$ + "End list" + ZFG3$ + CHR$(61) + _     ' DD032601
  385.                        ZFG2$ + CHR$(45) + ZEmphasizeOff$)            ' DD032601
  386. * INSERTING new line(s)
  387. 20179 IF Found THEN                                                  'Pe031793
  388.          ZOutTxt$ = "Relist Files To Mark?" + ZNoPrompt$             ' DD032601
  389.          ZTurboKey = - ZTurboKeyUser                                 ' lk 030993
  390.          GOSUB 21668                                                 ' lk 030993
  391.          IF ZYES THEN _                                              ' lk 030993
  392.             GOTO 20178                                               ' lk 030993
  393.       END IF                                                         'Pe031893
  394.       CALL KillWork (ZNodeWorkDrvPath$+"WILDDOWN.DEF")               ' DD030301/WILD
  395.       ZOutTxt$ = ""                                                  ' DD030301/WILD
  396.       ZOK = ZFalse                                                   ' DD030301/WILD
  397.       ZAutoLogoffReq = ZFalse                                        ' DD030301/WILD
  398. '
  399. ' *  D - COMMAND FROM FILES MENU (SEARCH FOR FILE TO DOWNLOAD)
  400. '
  401. * REPLACING old line(s) by new
  402. * ------[ first line different ]------
  403. 20180 Temp$ = CHR$(68)                                          'D   ' DD021301
  404.       NoTimeDnFlag = -1                                              ' DS090201
  405.       CALL AskItems (CHR$(68),Temp$,ZFalse,"file",ZMarkedFiles$)     ' DD021301
  406.       GOSUB 20177                                                    ' DD030301/WILD
  407.       IF ZFileSysParm > 1 THEN _
  408.          RETURN
  409.       IF ZWasQ = 0 THEN _
  410.          RETURN
  411. * REPLACING old line(s) by new
  412. 20202 IF (ZTimeLock AND 2) AND (NOT TimeLockExempt) AND NOT ZHasPrivDoor THEN _
  413.          CALL TimeLock : _
  414.          IF NOT ZOK THEN _
  415.             RETURN
  416.       LastDnld = ZLastIndex
  417.       FirstDnld = ZAnsIndex
  418.       ZCmdTransfer$ = ""
  419. * ------[ first line different ]------
  420. '     IF ZAutoDownYes THEN _                                         ' Mpl090202
  421. '        ZCmdTransfer$ = "X"                                         ' Mpl090202
  422. '     ZAutoDownInProgress = ZAutoDownYes                             ' Mpl090202
  423.       ZAnsIndex = ZLastIndex
  424.       GOSUB 20470
  425.       LastDnld = LastDnld + (WasX > 0)
  426.       BatchBytes# = 0
  427.       BatchBlocks# = 0
  428.       ZDownFiles = 0
  429.       CALL KillWork (ZNodeWorkFile$)
  430.       ZErrCode = 0
  431.       ZAnsIndex = FirstDnld
  432. * REPLACING old line(s) by new
  433. 20203 IF ZAnsIndex > LastDnld THEN _
  434.             GOTO 20204
  435.          GOSUB 20470
  436.          GOSUB 20205
  437.          IF ReStart THEN _
  438.             ReStart = ZFalse : _
  439.             GOTO 20202
  440.          ZCmdTransfer$ = ZWasFT$
  441.          CALL Line25
  442. * ------[ first line different ]------
  443.          IF ZFileSysParm > 1 OR ZInternalProt$ = CHR$(78) THEN _ 'N  ' DD021301
  444.             GOTO 20204
  445.       ZAnsIndex = ZAnsIndex + 1
  446.       GOTO 20203
  447. * REPLACING old line(s) by new
  448. 20205 MarkingTime = (ZAnsIndex = FirstDnld OR NOT ZConcatFIles)
  449.       ZFileName$ = ZUserIn$(ZAnsIndex)
  450. * ------[ first line different ]------
  451.       CALL AllCaps(ZFileName$)                                       'ANSIEd
  452.       CALL Remove (ZFileName$,", ")
  453.       ZViolation$ = "Download "
  454.       IF ZListOnly THEN _
  455.          CALL BreakFileName (ZFileName$,DR$,ZWasY$,WasX$,ZTrue) : _
  456.          ZFileNameHold$ = ZWasY$ + _
  457.                            WasX$ : _
  458.          GOTO 20235
  459.       ZFileNameHold$ = ZFileName$
  460. '                                                                    ' DD030301/WILD
  461. ' * WildCard Download Support                                        ' DD030301/WILD
  462. '                                                                    ' DD030301/WILD
  463. * INSERTING new line(s)
  464. 20208 IF INSTR(ZFileName$,"*") <> 0 THEN                             ' DD030301/WILD
  465.          IF ZWildDownOK AND NOT ZPersonalDnld THEN                   ' DD031803/WILD
  466.             ZLastIndex = 1                                           ' DD032003/WILD
  467.             LastDnld = 1                                             ' DD032003/WILD
  468.             CALL WildDown(ZFileName$, ZMarkedFiles$, ZFastFileList$, Found) ' DD030301/WILD
  469.             IF Found THEN                                            ' DD030301/WILD
  470.                GOTO 20178                                            ' DD030301/WILD
  471.             ELSE GOTO 20179                                          ' DD030301/WILD
  472.             END IF                                                   ' DD030301/WILD
  473.          END IF                                                      ' DD030301/WILD
  474.       END IF                                                         ' DD030301/WILD
  475.       TmpFileNameHold$ = ZFileNameHold$                              'Pe 06/04/92
  476.       CALL BadFile (ZFileName$,BadFileNameIndex)
  477.       ON BadFileNameIndex GOTO 20220,20231,20233
  478. 20210 CALL RotorsDir (ZFileName$,ZSubDir$(),ZSubDirCount + _         'Pe 06/01/92
  479.                       ((ZUserSecLevel < ZMinSecToView) OR _          'Pe 06/01/92
  480.                        NOT ZCanDnldFromUp),MarkingTime,CHR$(68)) 'D  ' DS041201
  481.       RETURN                                                         'Pe 06/01/92
  482. * REPLACING old line(s) by new
  483. * ------[ first line different ]------
  484. 20220 IF INSTR(ZFileName$,ZDefaultExtension$)= 0 THEN                'Pe 06/04/92
  485.          GOSUB 20210                                                 'Pe 06/02/92
  486.          IF ZOK THEN _                                               'Pe 06/02/92
  487.             GOTO 20235                                               'Pe 06/02/92
  488.          IF ZDotFlag THEN _                                          'Pe 06/02/92
  489.             RETURN                                                   'Pe 06/02/92
  490.       END IF                                                         'Pe 06/04/92
  491.       WasI = 1                                                       'Pe 06/01/92
  492. * DELETING old line(s)
  493. 20222
  494. * REPLACING old line(s) by new
  495. * ------[ first line different ]------
  496. 20225 CALL BreakFileName (ZFileName$,DR$,WasX$,Extension$,ZFalse)    'Pe 06/01/92
  497.       WasJ = INSTR(Mid$(ZCompressedExt$+". ",WasI),CHR$(46))         ' DD021301
  498.       IF WasJ = 0 THEN _                                             'Pe 04/18/92
  499.          GOTO 20231                                                  'Pe 06/04/92
  500.       Check$ = MID$(ZCompressedExt$,WasI,WasJ-1)                     'Pe 04/28/92
  501.       WasI = WasI + WasJ                                             'Pe 04/18/92
  502.       ZFileName$ = WasX$ + CHR$(46) + Check$                         ' DD021301
  503.       ZFileNameHold$ = ZFileName$                                    'Pe 04/18/92
  504.       GOSUB 20210                                                    'Pe 06/01/92
  505.       IF ZOK THEN _
  506.          GOTO 20235
  507.       IF ZDotFlag THEN _
  508.          RETURN
  509.       GOTO 20225                                                     'Pe 06/01/92
  510. * REPLACING old line(s) by new
  511. * ------[ first line different ]------
  512. 20231 ZOutTxt$ = TmpFileNameHold$ + _                                'Pe 04/18/92
  513.            " not found!"
  514.       CALL UpdtCalr (ZOutTxt$,2)
  515. '     IF ZAutoDownInProgress THEN _                                  ' Mpl090202
  516. '        ZOutTxt$ = ZOutTxt$ + _                                     ' Mpl090202
  517. '             " during AUTODOWNLOAD" : _                             ' Mpl090202
  518. '        GOSUB 21640 : _                                             ' Mpl090202
  519. '        RETURN                                                      ' Mpl090202
  520.       ZOutTxt$ = ZOutTxt$ + _
  521.            " Correct name? " + ZPressEnterExpert$                    ' DD090202
  522.       ZSuspendAutoLogoff = ZTrue
  523.       GOSUB 21660
  524.       ZSuspendAutoLogoff = ZFalse
  525.       IF ZFileSysParm > 1 THEN _
  526.          RETURN
  527.       IF ZWasQ=0 THEN _
  528.          IF ZBatchTransfer AND ZAnsIndex >= LastDnld THEN _
  529.             GOTO 20262 _
  530.          ELSE ZAutoLogOffReq = ZFalse : _
  531.               RETURN
  532.       ZUserIn$(ZAnsIndex) = ZUserIn$(1)
  533.       GOTO 20205
  534. * REPLACING old line(s) by new
  535. 20236 ZLine25$ = "(D) " + _
  536.                  ZWasZ$
  537. * ------[ first line different ]------
  538. '     IF ZAutoDownInProgress THEN _                                  ' Mpl090202
  539. '        MID$(ZLine25$,2,1) = CHR$(65)                          'A   ' DD021301
  540. '
  541. ' *  TEST FOR DOWNLOAD SECURITY
  542. '
  543.       ZViolation$ = "Download"                                       ' DGS-DS/TH
  544.       CALL FilSecChk (ZViolation$, ZFileName$, ZOK)                  ' DGS-DS/TH
  545.       IF NOT ZOK THEN _                                              ' DGS-DS/TH
  546.          GOTO 20245                                                  ' DGS-DS/TH
  547.       IF ZErrCode = 53 THEN _                                        ' DGS-DS/TH
  548.          CALL UpdtCalr ("Missing file " + ZFileSecFile$,2) : _       ' DGS-DS/TH
  549.          GOTO 20247                                                  ' DGS-DS/TH
  550.       IF ZErrCode <> 0 THEN _                                        ' DGS-DS/TH
  551.          ZWasEL = 20242 : _                                          ' DGS-DS/TH
  552.          GOTO 21900                                                  ' DGS-DS/TH
  553.       GOTO 20247                                                     ' DGS-DS/TH
  554. * DELETING old line(s)
  555. 20242
  556. 20243
  557. 20244
  558. * REPLACING old line(s) by new
  559. 20247 ZWasDF = 0
  560.       CALL BreakFileName (ZFileName$,DR$,WasX$,Extension$,ZFalse)
  561. * ------[ first line different ]------
  562. '     IF ZAutoDownInProgress THEN _                                  ' Mpl090202
  563. '        ZUserIn$(ZAnsIndex) = WasX$ + CHR$(46) + Extension$ : _     ' DD021301
  564. '        ZOutTxt$ = "Transferring -- " + _                           ' Mpl090202
  565. '             ZUserIn$(ZAnsIndex) : _                                ' Mpl090202
  566. '        GOSUB 21640 : _                                             ' Mpl090202
  567. '        IF ZFileSysParm > 1 THEN _                                  ' Mpl090202
  568. '           RETURN                                                   ' Mpl090202
  569.       IF INSTR("...WRK.FW .ARC.EXE.COM.OBJ.WKS.LBR.ZIP.PAK.ZOO.ARJ.LZH.",CHR$(46)+Extension$+CHR$(46)) > 2 OR _ ' DD021301
  570.          MID$(Extension$,2,1) = CHR$(81) OR _                   'Q   ' DD021301
  571.          (ZRequireNonASCII AND Extension$ = "BAS") THEN _
  572.             ZWasDF = ZTrue
  573. * REPLACING old line(s) by new
  574. 20260 ZTransferFunction = 1
  575. * ------[ first line different ]------
  576.       ZWasBatchTransfer = ZFalse                                     'Pe 03/02/92
  577.       ZUpBatchTransfer = ZFalse                                      'Pe 03/02/92
  578.       GOSUB 21790
  579.       IF ZFileSysParm > 1 THEN _
  580.          RETURN
  581.       ZBatchTransfer = ZBatchProto                                   'Pe Batch Mod
  582.       IF ZBatchTransfer AND ZCmdTransfer$ = "" THEN _
  583.          ZCmdTransfer$ = ZWasFT$
  584.       ON INSTR("AXCYN",ZInternalProt$) GOTO _
  585.          20340, _              ' ASCII DOWNLOAD
  586.          20290, _              ' Xmodem
  587.          20290, _              ' Xmodem CRC
  588.          20270, _              ' YMODEM
  589.          21700                 ' NONE - CANCEL
  590. '
  591. ' *  EXTERNAL Protocol Downloads/Uploads
  592. '
  593. * REPLACING old line(s) by new
  594. 20262 IF ZBatchTransfer THEN _
  595.          IF ZAnsIndex < LastDnld THEN _
  596.             RETURN _
  597.          ELSE ZBlocksInFile# = BatchBlocks# : _
  598.               ZBytesInFile# = BatchBytes# : _
  599.               ZNumDnldBytes! = BatchBytes# : _
  600.               IF ZBytesInFile# < 1 THEN _
  601.                  RETURN _
  602.               ELSE GOSUB 20780 : _
  603.                    IF ZFileSysParm > 1 OR NOT ZOK THEN _
  604.                       RETURN
  605. * ------[ first line different ]------
  606. '     IF ZAutoDownInProgress THEN _                                  ' Mpl090202
  607. '        CALL SendName : _                                           ' Mpl090202
  608.          IF ZAbort THEN _
  609.             ZAbort = ZFalse : _                                      'Pe 01/26/92
  610.             ZDnldCompleted = ZFalse : _
  611.             GOSUB 21760 : _
  612.             RETURN
  613.       GOSUB 20337
  614.       CALL Transfer
  615. * REPLACING old line(s) by new
  616. 20263 IF ZPrivateDoor THEN _
  617.          ZCmdTransfer$ = ZWasFT$ : _
  618.          CALL XferType (2,ZTrue) : _
  619.          ZCmdTransfer$ = ""
  620.       CALL OpenWork (2,"XFER-" + ZNodeID$ + ".DEF")
  621.       IF ZErrCode <> 0 THEN _
  622.          GOTO 20267
  623.       CALL ReadParms (ZWorkAra$(), ZFailureParm, 1)
  624.       IF ZErrCode <> 0 THEN _
  625.          GOTO 20267
  626.       CLOSE 2
  627. * ------[ first line different ]------
  628.       IF NOT ZFakeXRpt THEN                                          'Pe 03/26/92
  629.          CALL LinesInFile("XFER-" + ZNodeId$ + ".DEF", XferCount)    ' DGS051605-DS
  630.          IF ZAdvanceProtoWrite AND XferCount < 2 THEN _              ' DGS051605-DS
  631.             GOTO 20264                                               ' DGS051605-DS
  632.       END IF                                                         ' DGS051605-DS
  633.       Call TStats                                                    'Pe 03/26/92
  634. * REPLACING old line(s) by new
  635. * ------[ first line different ]------
  636. 20264 CALL KillWork ("XFER-" + ZNodeID$ + ".DEF")                    ' DGS051605-DS
  637.       IF ZPrivateDoor THEN _                                         ' DGS051605-DS
  638.          ZFileName$ = ZWorkAra$(1) : _
  639.          CALL BreakFileName (ZFileName$,WasX$,ZFileNameHold$,ZWasY$,ZTrue) : _
  640.          ZFileNameHold$ = ZFileNameHold$ + _
  641.                            ZWasY$
  642.       IF LEFT$(ZWorkAra$(ZFailureParm),1) = CHR$(76) THEN _     'L   ' DD021301
  643.          MID$(ZWorkAra$(ZFailureParm),1,1) = ZFailureString$
  644. * REPLACING old line(s) by new
  645. 20265 IF ZTransferFunction = 2 THEN _
  646.          IF INSTR(ZWorkAra$(ZFailureParm),ZFailureString$) <> 1 THEN _
  647.             GOTO 20700 _
  648.          ELSE GOTO 20730
  649.       IF ZTransferFunction = 1 THEN _
  650. * ------[ first line different ]------
  651.          ZDnldCompleted = (INSTR(ZWorkAra$(ZFailureParm),ZFailureString$) <> 1)  'Pe 05/30/91
  652.       GOSUB 21760
  653.       CALL Carrier
  654.       IF ZSubParm = -1 THEN _
  655.          ZFileSysParm = 7
  656.       RETURN
  657. '
  658. ' *  XFER FILE NOT Found
  659. '
  660. * REPLACING old line(s) by new
  661. 20292 GOSUB 20750
  662.       IF ZFileSysParm > 1 OR NOT ZOK THEN _
  663.          RETURN
  664.       WasA1$ = "SEND"
  665.       GOSUB 20320
  666.       IF ZFileSysParm > 1 THEN _
  667.          RETURN
  668.       IF ZLocalUser THEN _
  669.          CALL QuickTPut1 ("Protocol not available in local mode") : _
  670.          RETURN
  671. * ------[ first line different ]------
  672. '      IF ZAutoDownInProgress THEN _
  673. '         GOSUB 20294 : _
  674. '         IF ZAbort THEN _
  675. '            RETURN
  676.       GOSUB 21300
  677.       IF ZFileSysParm > 1 THEN _
  678.          RETURN
  679.       ZOutTxt$ = ""
  680.       GOTO 20390
  681. '20294 CALL SendName                                                 ' DD062304
  682. '     RETURN                                                         ' Mpl090902
  683. * DELETING old line(s)
  684. 20294
  685. * REPLACING old line(s) by new
  686. 20325 IF ZCheckSum THEN _
  687.          ZNAK$ = CHR$(21) : _
  688.          SOL = 132 _
  689. * ------[ first line different ]------
  690.       ELSE ZNAK$ = CHR$(67) : _                                 "C   ' DD021301
  691.            SOL = 133
  692. '20330 IF ZAutoDownInProgress THEN _                                 ' DD062304
  693. '         RETURN
  694.       GOSUB 20337
  695.       ZOutTxt$ = ZFGE$ + "Protocol: " + ZFGA$ + ZProtoPrompt$ + _    ' DD112001
  696.             SPACE$(1) + ZFGB$ + WasA1$ + _                           ' DD021301
  697.             ZFGA$ + " of " + _                                       ' DD112001
  698.             ZFGB$ + ZFileNameHold$ + _                               ' DD112001
  699.             ZFGA$ + " ready.  " + ZFGF$ + ZBG1$ + "<Ctrl X> aborts" + _ 'DD112001
  700.             ZEmphasizeOff$                                           ' DD112001
  701.       GOSUB 21650
  702.       CALL SetUpTransferInfo                                         ' DD021301
  703.       CALL LPrnt (ZOutTxt$,1)                                        ' DD112002
  704. '20335 IF ZTransferFunction = 1 THEN _                               ' DD060401
  705. '        CALL Talk (8,ZOutTxt$) _                                    ' DD060401
  706. '     ELSE CALL Talk (9,ZOutTxt$)                                    ' DD060401
  707.       RETURN
  708. * DELETING old line(s)
  709. 20330
  710. 20335
  711. * REPLACING old line(s) by new
  712. 20340 IF ZWasDF THEN _
  713.          ZOutTxt$ = "Switch to a non-ascii protocol" : _
  714.          GOSUB 21650 : _
  715.          GOTO 21700
  716.       GOSUB 20750
  717.       IF ZFileSysParm > 1 OR NOT ZOK THEN _
  718.          RETURN
  719.       CALL OpenWork (2,ZFileName$)
  720.       IF (ZAnsIndex = FirstDnld OR NOT ZConcatFIles) THEN _
  721.          GOSUB 20337 : _
  722.          ZOutTxt$ = "^X aborts.  ^S suspends ^Q resumes" : _
  723.          GOSUB 21640 : _
  724.          IF ZFileSysParm > 1 THEN _
  725.             RETURN _
  726.          ELSE ZOutTxt$ = ZProtoPrompt$ + " SEND of " + _
  727.               ZFileNameHold$ + _
  728.               " ready. Press Any Key to start" : _
  729.          ZTurboKey = 2 : _
  730.          ZForceKeyboard = ZTrue : _
  731.          ZSuspendAutologoff = ZTrue : _
  732.          GOSUB 21660 : _
  733.          ZSuspendAutologoff = ZFalse : _
  734. * ------[ first line different ]------
  735.          IF ZFileSysParm > 1 THEN _
  736.             RETURN
  737. * REPLACING old line(s) by new
  738. 20380 ZStopInterrupts = ZFalse
  739.       WasTU = 0
  740.       SWAP WasTU,ZPageLength
  741.       CALL BufFile (ZFileName$,WasX)
  742.       SWAP WasTU,ZPageLength
  743.       ZNonStop = (ZPageLength < 1)
  744.       IF StopFile THEN _
  745. * ------[ first line different ]------
  746.          ZDnldCompleted = ZFalse : _                                 'Pe 05/29/91
  747.          GOTO 20390
  748. * REPLACING old line(s) by new
  749. 20381 IF (ZAnsIndex = LastDnld OR NOT ZConcatFIles) THEN _
  750.          CALL QuickTPut (CHR$(26),0) : _
  751.          IF NOT ZLocalUser AND ZSubParm = 0 THEN _
  752.             FOR WasX = 1 TO 5 : _
  753. * ------[ first line different ]------
  754.                CALL PutCom (ZBellRinger$) : _                        ' DD070402
  755.                CALL DelayTime (3) : _
  756.             NEXT
  757. * REPLACING old line(s) by new
  758. 20385 ZDnldCompleted = ZTrue                                         'Pe 05/30/91
  759. * REPLACING old line(s) by new
  760. 20400 CALL TimeBack (1)
  761. * ------[ first line different ]------
  762.       ZUpBatchTransfer = ZFalse                                      'Pe 12/08/91
  763.       ZWasBatchTransfer = ZFalse                                     ' Mpl090202
  764.       GOSUB 20420
  765.       ZAutoLogOffReq = 0
  766.       FirstUpld = ZAnsIndex
  767.       GOTO 20430
  768. * INSERTING new line(s)
  769. 20410 CALL TimeBack (1)                                              ' Mpl090202
  770.       CALL KillWork (ZBatchWorkFile$)                                'Pe Batchup mod
  771.       ZErrCode = 0                                                   ' Mpl090202
  772.       ZUpBatchTransfer = ZTrue                                       ' Mpl090202
  773.       Call Killwork (ZNodeWorkDrvPath$ + "BatchUp" +ZNodeID$ +".LST")' DD032501
  774.       ZErrCode = 0                                                   ' Mpl090202
  775.       ZAutoLogOffReq = 0                                             ' Mpl090202
  776.       IF LEN(ZUserIn$) < 3 THEN _                                    ' Mpl090202
  777.          CALL UploadMessage : _                                      ' DD090102
  778.          CALL Batchit : _                                            ' Mpl090202
  779.          FirstUpld = 2 : _                                           ' Mpl090202
  780.          LastUpld = ZLastIndex : _                                   ' Mpl090202
  781.          GOTO 20430                                                  ' Mpl090202
  782.       FirstUpld = ZAnsIndex                                          ' Mpl090202
  783.       GOTO 20430                                                     ' Mpl090202
  784. * REPLACING old line(s) by new
  785. * ------[ first line different ]------
  786. 20420 CALL UploadMessage                                             ' DD090102
  787.       ZOutTxt$ = "Upload what file(s)" + ZPressEnterExpert$          ' DD091207
  788.       GOSUB 21667
  789.       RETURN
  790. '
  791. ' *  SEARCH FOR DUPLICATE FILENAME
  792. '
  793. * REPLACING old line(s) by new
  794. 20435 ZFileNameHold$ = ZUserIn$(ZAnsIndex)
  795.       ExtSrch = ZFalse
  796. * ------[ first line different ]------
  797.       IF INSTR(ZFileNameHold$,CHR$(46)) = 0 THEN _                   ' DD021301
  798.          ZFileNameHold$ = ZFileNameHold$ + CHR$(46) + ZDefaultExtension$ ' DD021301
  799.       CALL AllCaps(ZFileNameHold$)
  800.       ZFileName$ = ZFileNameHold$
  801.       ZViolation$ = "Upload "
  802.       CALL NoPath (ZFileName$,BadFileNameIndex)
  803.       IF BadFileNameIndex THEN _
  804.          GOTO 20451
  805.       CALL BadFile (ZFileName$,BadFileNameIndex)
  806.       ON BadFileNameIndex GOTO 20440,20451,20515
  807. * REPLACING old line(s) by new
  808. * ------[ first line different ]------
  809. 20440 FileIsHack = ZFalse                                            ' DD080901
  810.       FileInList = ZFalse                                            ' DD080901
  811.       FileOffLine = ZFalse                                           ' DD080901
  812.       TmpName$ = "TWITLIST.DEF"                                      ' DD120802/TWIT
  813.       CALL FindIt (TmpName$)                                         ' DD120802/TWIT
  814.       IF ZOK THEN                                                    ' DD120802/TWIT
  815.          CALL OpenWork(2,TmpName$)                                   ' DD120802/TWIT
  816.          IsATwit = ZFalse                                            ' DD120802/TWIT
  817.          TwitName$ = ""                                              ' DD120802/TWIT
  818.          WHILE NOT EOF(2) AND NOT IsATwit                            ' DD120802/TWIT
  819.             INPUT #2, TwitName$                                      ' DD120802/TWIT
  820.             CALL AllCaps (TwitName$)                                 ' DD120802/TWIT
  821.             IsATwit = (INSTR(ZActiveUserName$,TwitName$) > 0)        ' DD120802/TWIT
  822.          WEND                                                        ' DD120802/TWIT
  823.          CLOSE 2                                                     ' DD120802/TWIT
  824.          IF IsATwit THEN _                                           ' DD120802/TWIT
  825.             FileOffLine = ZTrue : _                                  ' DD120802/TWIT
  826.             GOTO 20443                                               ' DD120802/TWIT
  827.       END IF                                                         ' DD010401/HACKLIST
  828.       TmpName$ = ZDirPath$ + "HACK.DEF"                              ' DD010401/HACKLIST
  829.       CALL FindIt (TmpName$)                                         ' DD010401/HACKLIST
  830.       IF ZOK THEN                                                    ' DD010401/HACKLIST
  831.          CALL OpenWork (2, TmpName$)                                 ' DD010401/HACKLIST
  832.          HaveFile$ = ""                                              ' DD010401/HACKLIST
  833.          FileIsHack = ZFalse                                         ' DD010401/HACKLIST
  834.          WHILE NOT EOF(2) AND NOT FileIsHack                         ' DD010401/HACKLIST
  835.            LINE INPUT #2, HaveFile$                                  ' DD061101
  836.            CALL AllCaps (HaveFile$)                                  ' DD061101
  837.            HaveFile$ = HaveFile$ + CHR$(46)                          ' BC080901
  838.            StopReading = INSTR(HaveFile$,CHR$(46))                   ' DD061101
  839.            HaveFile$ = Left$(HaveFile$,StopReading)                  ' DD061101
  840.            Search = INSTR(ZFileNameHold$,CHR$(46))                   ' DD061101
  841.            Search$ = Left$(ZFileNameHold$,Search)                    ' DD061101
  842.            IF Search$ = HaveFile$ THEN_                              ' DD061101
  843.               FileIsHack = ZTrue                                     ' DD061101
  844.          WEND                                                        ' DD010401/HACKLIST
  845.          CLOSE 2                                                     ' DD010401/HACKLIST
  846.       END IF                                                         ' DD010401/HACKLIST
  847.       IF FileIsHack THEN _                                           ' DD010401/HACKLIST
  848.       GOTO 20443                                                     ' DD010401/HACKLIST
  849.       TmpName$ = ZDirPath$+"NOTHANX.DEF"                             'Pe 06/01/92
  850.       CALL FindIt (TmpName$)                                         'DGS-UNW
  851.       IF ZOK THEN                                                    ' Mpl090202
  852.          CALL OpenWork (2,TmpName$)                                  ' Mpl090202
  853.          HaveFile$ = ""                                              ' Mpl090202
  854.          FileInList = ZFalse                                         ' Mpl090202
  855.          WHILE NOT EOF(2) AND NOT FileInList                         ' Mpl090202
  856.             INPUT #2, HaveFile$                                      ' Mpl090202
  857.             CALL AllCaps (HaveFile$)                                 ' Mpl090202
  858.             FileInList = (INSTR(ZFileNameHold$,HaveFile$) > 0)       ' DD042603
  859.          WEND                                                        ' Mpl090202
  860.          CLOSE 2                                                     ' Mpl090202
  861.       END IF                                                         ' Mpl090202
  862.       IF FileInList THEN _                                           ' Mpl090202
  863.       GOTO 20443                                                     ' Mpl090202
  864.       TmpName$ = ZDirPath$ + ZMainFMSDir$ + ".OFL"                   ' DD050604
  865.       CALL FindIt (TmpName$)                                         ' DD050604
  866.       IF NOT ZOK THEN                                                ' DD050604
  867.          TmpName$ = ZDirPath$ + "OFFLINE.DEF"                        ' DD050604
  868.          CALL FindIt (TmpName$)                                      ' DD050604
  869.       END IF                                                         ' DD050604
  870.       IF ZOK THEN                                                    ' Mpl090202
  871.          CALL OpenWork (2,TmpName$)                                  ' Mpl090202
  872.          HaveFile$ = ""                                              ' Mpl090202
  873.          FileOffLine = ZFalse                                        ' DD092001
  874.          WHILE NOT EOF(2) AND NOT FileOffLine                        ' DD092001
  875.             LINE INPUT #2, HaveFile$                                 'Pe 12/15/91
  876.             CALL AllCaps (HaveFile$)                                 ' Mpl090202
  877.             StopReading = INSTR(HaveFile$,CHR$(46))                  ' DD021301
  878.             IF StopReading > 0 THEN                                  ' DD080901
  879.                HaveFile$ = Left$(HaveFile$,StopReading)              ' DD080901
  880.             END IF                                                   ' DD080901
  881.             Search = INSTR(ZFileNameHold$,CHR$(46))                  ' DD021301
  882.             IF Search > 0 THEN                                       ' DD080901
  883.                Search$ = Left$(ZFileNameHold$,Search)                ' DD080901
  884.             ELSE                                                     ' DD080901
  885.                Search$ = ZFileNameHold$                              ' DD080901
  886.             END IF                                                   ' DD080901
  887.             IF Search$ = HaveFile$ THEN                              ' DD080901
  888.                FileOffLine = ZTrue                                   ' DD092001
  889.             END IF                                                   ' DD080901
  890.          WEND                                                        ' Mpl090202
  891.       CLOSE 2                                                        ' Mpl090202
  892.       END IF                                                         ' Mpl090202
  893. * INSERTING new line(s)
  894. 20443   IF ZSysop THEN _                                             ' Mpl090202
  895.            FileinList = ZFalse : _                                   ' DD092001
  896.            FileOffLine = ZFalse                                      ' DD092001
  897.         IF FileIsHack THEN _                                         ' DD010401/HACKLIST
  898.            CALL BufFile (ZHelpPath$ + "HACK.MSG",WasX) : _           ' DD010401/HACKLIST
  899.            GOTO 20453                                                ' DD010401/HACKLIST
  900.         IF FileInList THEN _                                         ' Mpl090202
  901.            CALL BufFile (ZHelpPath$+"NOTHANX.MSG",WasX) : _          'Pe 06/01/92
  902.            GOTO 20453                                                ' Mpl090202
  903.         IF FileOffLine THEN _                                        ' DD092001
  904.            CALL BufFile (ZHelpPath$+"OFFLINE.MSG",WasX) : _          ' DD092001
  905.            GOTO 20453                                                ' DD092001
  906.         CALL Carrier                                                 ' Mpl090202
  907.         IF ZSubParm = -1 THEN _                                      ' Mpl090202
  908.            ZFileSysParm = 7 : _                                      ' Mpl090202
  909.            RETURN                                                    ' Mpl090202
  910.       PersFile$ = ZFileName$                                         'Pe 08/09/91
  911.       ZFileName$ = ZPersonalDrvPath$ + PersFile$                     'Pe 08/08/91
  912.       Call FindFile (ZFileName$,ZOK)                                 'Pe 08/09/91
  913.       IF ZOK THEN Goto 20452                                         'Pe 08/09/91
  914.       ZFileName$ = PersFile$                                         'Pe 08/09/91
  915.       CALL RotorsDir (ZFileName$,ZSubDir$(),ZSubDirCount,ZTrue,CHR$(85)) ' DD021301
  916. * REPLACING old line(s) by new
  917. 20445 IF ZOK THEN _
  918.          GOTO 20452
  919. * ------[ first line different ]------
  920.       IF INSTR(ZFileName$,CHR$(46)) = 0 THEN _                       ' DD021301
  921.          GOTO 20475
  922.       CALL BreakFileName (ZFileName$,DR$,WasX$,Extension$,ZFalse)
  923.       WasI = 1
  924. * REPLACING old line(s) by new
  925. * ------[ first line different ]------
  926. 20447 WasJ = INSTR(MID$(ZCompressedExt$+". ",WasI),CHR$(46))         ' DD021301
  927.       IF WasJ = 0 THEN _
  928.          GOTO 20475
  929.       Check$ = MID$(ZCompressedExt$,WasI,WasJ-1)
  930.       WasI = WasI + WasJ
  931. * REPLACING old line(s) by new
  932. 20450 IF Extension$ <> Check$ THEN _
  933. * ------[ first line different ]------
  934.       CALL RotorsDir (WasX$ + CHR$(46) + Check$,ZSubDir$(),ZSubDirCount,ZTrue,CHR$(85)) : _ ' DD021301
  935.          IF ZOK THEN _
  936.             ExtSrch = ZTrue : _
  937.             GOTO 20452
  938.       GOTO 20447
  939. * REPLACING old line(s) by new
  940. * ------[ first line different ]------
  941. 20451 ZOutTxt$ = "Invalid file name <" + ZFileName$ + CHR$(62)       ' DD021301
  942.       GOTO 20395
  943. * REPLACING old line(s) by new
  944. 20452 IF ZUserSecLevel < ZOverWriteSecLevel THEN _
  945.          GOTO 20453
  946. * ------[ first line different ]------
  947.       IF ExtSrch AND (WasX$ + CHR$(46) + Check$) <> ZFileName$ THEN _ ' DD021301
  948.          ZOutTxt$ = WasX$ + CHR$(46) + Check$ + " already here, " + _ ' DD021301
  949.                     "upload anyway?" + ZNoPrompt$ _                  ' DD060101
  950.       ELSE ZOutTxt$ = "Overwrite file?" + ZNoPrompt$                 ' DD060101
  951.       GOSUB 21660
  952.       IF ZFileSysParm > 1 THEN _
  953.          RETURN
  954.       IF NOT ZYes THEN _
  955.          GOTO 20453
  956.       ZWasZ$ = ZFileName$
  957.       CALL KillWork (ZFileName$)
  958.       IF ZErrCode <> 0 AND ZErrCode <> 53 THEN _
  959.          ZOutTxt$ = "Unable to overwrite" : _
  960.          GOSUB 21660 : _
  961.          RETURN
  962.       GOTO 20475
  963. * REPLACING old line(s) by new
  964. 20453 CLOSE 2
  965. * ------[ first line different ]------
  966.       IF FileIsHack OR FileInList THEN                               ' BC080902
  967.          CALL UpdtCalr ("Upload of unwanted file " + _               ' BC080902
  968.                        ZFileNameHold$ + " attempted",1)              ' BC080902
  969.          IF ZUserSecLevel < ZSysopSecLevel THEN                      ' BC080902
  970.             RETURN                                                   ' BC080902
  971.          ELSE                                                        ' BC080902
  972.             GOTO 20455                                               ' BC080902
  973.          END IF                                                      ' BC080902
  974.       END IF                                                         ' BC080902
  975.       IF ZUserSecLevel >= ZAddDirSecurity THEN _ 
  976.          GOTO 20455 
  977. * REPLACING old line(s) by new
  978. * ------[ first line different ]------
  979. 20454 IF FileOffLine THEN                                            ' DD080901
  980.          CALL QuickTPut1 ("Thanks, but we already have " + ZFileNameHold$) ' DD080901
  981.       END IF                                                         ' DD080901
  982.       CALL SmartPause                                                ' DD080901
  983.       PersFile$ = ""                                                 'Pe 08/08/91
  984.       CALL UpdtCalr ("Upload duplicate " + ZFileNameHold$,1)
  985.       RETURN
  986. * REPLACING old line(s) by new
  987. * ------[ first line different ]------
  988. 20455 ZOutTxt$ = "Add new directory entry?" + ZNoPrompt$             ' DD060101
  989.       ZTurboKey = - ZTurboKeyUser
  990.       GOSUB 21660
  991.       IF ZFileSysParm > 1 THEN _
  992.          RETURN
  993.       IF NOT ZYes THEN _
  994.          RETURN
  995.       GOSUB 20460
  996.       IF WhoTo$ = "" THEN _
  997.          RETURN
  998.       AddingDescOnly = ZTrue
  999.       ZWasBatchTransfer = ZFalse                                     'Pe 01/03/92
  1000.       ZWasFT$ = CHR$(108)                                       'l   ' DD021301
  1001.       CALL UpdtUpload (ZCategoryName$(),ZCategoryCode$(),ZLinesInMsg,1) 'UPL-MOD pe082690
  1002.       GOSUB 20702
  1003.       RETURN
  1004. * REPLACING old line(s) by new
  1005. * ------[ first line different ]------
  1006. 20460 CALL KillWork (ZNodeWorkFile$)                                 'Pe BatchUp
  1007.       WhoTo$ = ""
  1008.       IF ZUpBatchTransfer THEN _                                     'Pe 04/29/92
  1009.          WhoTo$ = "ALL"                                              'Pe 04/29/92
  1010.       WasY$ = ZFileName$
  1011.       IF ZUserSecLevel >= ZMinSecPersUpld THEN _
  1012.          CALL SetWhoTo (ZTrue,WhoTo$,"",RcvrRecNum,Found,ZTrue) _    ' KG012502
  1013.       ELSE WhoTo$ = "ALL"
  1014.       ZFileName$ = WasY$
  1015.       RETURN
  1016. * REPLACING old line(s) by new
  1017. 20471 ZWasZ$ = ZUserIn$(ZAnsIndex)
  1018.       CALL AllCaps(ZWasZ$)
  1019.       WasX = 0
  1020.       IF LEN (ZWasZ$) = 1 THEN _
  1021.          WasX = INSTR(ZDefaultXfer$,ZWasZ$) : _
  1022. * ------[ first line different ]------
  1023. '        IF WasX > 0 THEN _                                          ' Mpl090202
  1024. '           ZAnsIndex = ZAnsIndex + 1 : _                            ' Mpl090202
  1025. '           IndexSave = IndexSave + 1 : _                            ' Mpl090202
  1026. '           ZCmdTransfer$ = ZWasZ$ : _                               ' Mpl090202
  1027. '           ZAutoDownInProgress = ZFalse : _                         ' Mpl090202
  1028. '           IF MID$(ZInternalEquiv$,WasX,1) = CHR$(78) THEN _   'N   ' DD021301
  1029. '              ZCmdTransfer$ = ""                                    ' Mpl090202
  1030.          IF WasX > 0 THEN _
  1031.             ZAnsIndex = ZAnsIndex + 1 : _
  1032.             IndexSave = IndexSave + 1 : _
  1033.             ZCmdTransfer$ = ZWasZ$ : _
  1034.             IF MID$(ZInternalEquiv$,WasX,1) = CHR$(78) THEN _   'N   ' DD021301
  1035.                ZCmdTransfer$ = ""
  1036.       RETURN
  1037. * REPLACING old line(s) by new
  1038. 20475 ZWasZ$ = ZUpldDriveFile$
  1039.       CALL FindFree
  1040.       IF VAL(ZFreeSpace$) < 4096 THEN _
  1041.          GOSUB 21895 : _
  1042.          IndexSave = ZLastIndex + 1 : _
  1043.          RETURN
  1044.       ZOutTxt$ = "Upload disk has" + _
  1045.            ZFreeSpace$
  1046.       GOSUB 21640
  1047.       IF ZFileSysParm > 1 THEN _
  1048.          RETURN
  1049. * ------[ first line different ]------
  1050.       GOSUB 20460                                                    'Pe 08/08/91
  1051.       IF ZMplPersUpload = ZTrue THEN _                               'Pe 08/09/91
  1052.          ZFileName$ = ZPersonalDrvPath$ + PersFile$                  'Pe 08/08/91
  1053.       CALL UpdtUpload (ZCategoryName$(),ZCategoryCode$(),ZLinesInMsg,1)' Mpl090202
  1054. * INSERTING new line(s)
  1055. 20476 IF ZAbort THEN _                                               'Pe 09/07/91 added line number
  1056.          ZAbort = ZFalse : _                                         'PE 12/14/88
  1057.          RETURN
  1058.       ZLine25$ = "(U) " + _
  1059.                  ZFileNameHold$
  1060.       ZSubParm = 2
  1061.       CALL Line25
  1062.       ZOutTxt$ = ""
  1063.       ZOK = ZTrue
  1064. * REPLACING old line(s) by new
  1065. 20500 ZTransferFunction = 2
  1066. * ------[ first line different ]------
  1067. '     ZAutoDownInProgress = ZFalse                                   ' Mpl090202
  1068.       GOSUB 21790
  1069.       IF ZFileSysParm > 1 THEN _
  1070.          RETURN
  1071.       IF ZInternalProt$ = CHR$(78) THEN _                       'N   ' DD021301
  1072.          GOTO 21700                                                  'Pe 08/08/91
  1073.       IF NOT ZUpBatchTransfer THEN _
  1074.          CALL AutoLogOff                                             'Pe 02/04/90
  1075.       IF ZAutoEnd = 2 THEN _
  1076.          RETURN
  1077.       ON INSTR("AXCYN",ZInternalProt$) GOTO _
  1078.          20560, _         ' ASCII UPLOAD
  1079.          20542, _         ' Xmodem
  1080.          20542, _         ' Xmodem CRC
  1081.          20542, _         ' YMODEM
  1082.          20735            ' NONE - CANCEL
  1083.       GOTO 20261
  1084. * REPLACING old line(s) by new
  1085. * ------[ first line different ]------
  1086. 20510 WasD$ = ZFGF$ + ZBG1$ + "<Esc> by SysOp aborts" + ZBG0$ + _    ' DD112001
  1087.               ZEmphasizeOff$ + ZCrLf$                                ' DD112001
  1088.       GOSUB 21710
  1089.       RETURN
  1090. * REPLACING old line(s) by new
  1091. 20560 LineACK = (ZDefaultLineACK$ <> "")
  1092.       IF LineACK THEN _
  1093. * ------[ first line different ]------
  1094.          ZOutTxt$ = "Acknowledge each line?" + ZYesPrompt$ : _       ' DD060101
  1095.          ZTurboKey = - ZTurboKeyUser : _
  1096.          LineACK = NOT ZNo : _
  1097.          GOSUB 21660 : _
  1098.          IF ZFileSysParm > 1 THEN _
  1099.             RETURN
  1100.       GOSUB 20337
  1101.       CALL QuickTPut1 ("Transfer MUST end with a <Ctrl-K>")
  1102.       CALL QuickTPut1 (ZProtoPrompt$+" RECEIVE of " + ZFileNameHold$ + " ready")
  1103.       ZOK = ZFalse
  1104.       XOff = ZFalse
  1105.       CALL OpenOutW(ZFileName$)
  1106.       IF ZErrCode <> 0 AND ZErrCode <> 53 THEN _
  1107.          ZWasEL = 20560 : _
  1108.          GOTO 21900
  1109.       GOSUB 20510
  1110.       IF ZFileSysParm > 1 THEN _
  1111.          RETURN
  1112. * REPLACING old line(s) by new
  1113. 20650 WasX = INSTR(WasX$,CHR$(11))
  1114.       IF WasX = 1 THEN _
  1115.          IF NOT ZOK THEN _
  1116.             GOTO 20730 _
  1117.          ELSE GOTO 20700
  1118. * ------[ first line different ]------
  1119.       CALL PrintWorkA (2,LEFT$(WasX$,WasX-1))                        ' DD040601
  1120.       IF ZErrCode <> 0 THEN _
  1121.          ZWasEL = 20650 : _
  1122.          GOTO 21900
  1123.       GOTO 20700
  1124. * REPLACING old line(s) by new
  1125. 20700 GOSUB 21780
  1126.       IF ZFileSysParm > 1 THEN _
  1127.          RETURN
  1128. * ------[ first line different ]------
  1129.       IF ZWasBatchTransfer THEN _                                    ' Mpl090202
  1130.          CALL BatchUpload (ZDesc$,ZUCat$,2) : _                      ' Mpl090202
  1131.          GOTO 20703                                                  ' Mpl090202
  1132. * REPLACING old line(s) by new
  1133. 20702 CALL UpdtUpload (ZCategoryName$(),ZCategoryCode$(), ZLinesInMsg,2) 'Pe 02/03/90
  1134. * INSERTING new line(s)
  1135. 20703 IF ZAutoEnd = 1 THEN _                                         'AUTO-UP MOD
  1136.          ZFileSysParm = 7: _                                         'Pe BatchUp 09/12/91
  1137.          ZDnldCompleted = ZTrue : _                                  'Pe BatchUp 09/12/91
  1138.          RETURN                                                      'AUTO-UP MOD
  1139.       IF NOT ZGetExtDesc THEN _
  1140.          ZPrivateDoor = ZFalse : _
  1141.          GOTO 20710
  1142.       ZMsgHeader$ = "Extended Description of " + ZFileNameHold$      ' DD031007
  1143.       ZSysopComment = ZTrue
  1144.       ZMaxMsgLines = ZMaxExtendedLines
  1145.       WasLL = ZRightMargin
  1146.       ZRightMargin = 30 + ZMaxDescLen
  1147.       IF ZRightMargin > 74 THEN _
  1148.          ZRightMargin = 74
  1149.       ZFileSysParm = 5
  1150.       RETURN
  1151. * REPLACING old line(s) by new
  1152. 20705 ZMaxMsgLines = ZMaxMsgLinesDef
  1153.       ZRightMargin = WasLL
  1154. * ------[ first line different ]------
  1155. '     GOSUB 20702                                                    ' Mpl090202
  1156.       CALL UpdtUpload (ZCategoryName$(),ZCategoryCode$(),ZLinesInMsg,3) 'Pe 02/04/90
  1157. * REPLACING old line(s) by new
  1158. 20730 GOSUB 21780
  1159.       CALL QuickTPut1 ("Upload aborted")
  1160. * ------[ first line different ]------
  1161.       ZAutoLogoffReq = ZFalse                                        'Pe 10/20/91
  1162.       ZWasBatchTransfer = ZFalse                                     'Pe 03/02/92
  1163.       ZUpBatchTransfer = ZFalse                                      'Pe 03/02/92
  1164.       LastUpld = 0
  1165.       ZPrivateDoor = ZFalse
  1166. * REPLACING old line(s) by new
  1167. * ------[ first line different ]------
  1168. 20750 ZStartOfHeader$ = CHR$(1 - (ZInternalProt$ = CHR$(89)))   'Y   ' DD021301
  1169.       CALL OpenRSeq (2,ZFileName$,MaxBlock,ZWasDF,ZFLen)             ' DD031703
  1170. * REPLACING old line(s) by new
  1171. 20760 IF ZErrCode <> 0 THEN _
  1172.          CALL QuickTPut1 ("Unable to access "+ZFileNameHold$) : _
  1173.          CALL UpdtCalr ("Unable to access "+ZFileName$,2) : _
  1174.          ZOK = ZFalse : _
  1175.          ZErrCode = 0 : _
  1176.          ZBytesInFile# = 0 : _
  1177.          RETURN
  1178.       ZBytesInFile# = LOF(2)
  1179.       ZNumDnldBytes! = LOF(2)
  1180.       ZOK = ZTrue
  1181.       IF SizeOnly THEN _
  1182.          SizeOnly = ZFalse : _
  1183.          RETURN
  1184.       ZBlocksInFile# = MaxBlock
  1185.       IF ZBatchTransfer THEN _
  1186.          BatchBlocks# =  BatchBlocks# + ZBlocksInFile# : _
  1187.          BatchBytes# = BatchBytes# + ZBytesInFile# : _
  1188. * ------[ first line different ]------
  1189.          CALL OpenWorkA (2,ZNodeWorkFile$) : _                       ' DD040601
  1190.          CALL PrintWorkA (2,ZFileName$) : _                          ' DD040601
  1191.          ZDownFiles = ZDownFiles + 1 : _
  1192.          CLOSE 2 : _
  1193.          RETURN
  1194.       ZDownFiles = 1
  1195. * REPLACING old line(s) by new
  1196. * ------[ first line different ]------
  1197. 20780 ZOutTxt$ = ZCRLf$ + ZFGA$ + "File Size: " + ZFGE$              ' DD080405
  1198.       ZOK = ZTrue
  1199.       IF ZBlockSize > 0 THEN _
  1200.          ZOutTxt$ = ZOutTxt$ + _
  1201.               STR$(FIX(ZBlocksInFile#)) + _
  1202.               ZFG2$ + " blocks "                                     ' DD082205
  1203. * REPLACING old line(s) by new
  1204. 20785 ZBlocksInFile# = ZBlocksInFile# / _
  1205.          VAL(MID$("000003000450120024004800720096012001440168019203840", -4 * ZCBPS, 4))
  1206.       ZBlocksInFile# = ZBlocksInFile# * ZFLen / ZSpeedFactor!
  1207.       IF (ZAnsIndex > 1 AND ZConcatFIles) THEN _
  1208.          RETURN
  1209.       ZOutTxt$ = ZOutTxt$ + _
  1210. * ------[ first line different ]------
  1211.            ZFGE$ + STR$(ZBytesInFile#) + _                           ' DD082205
  1212.            ZFG2$ + " bytes"                                          ' DD082205
  1213.       GOSUB 21650
  1214.       IF ZFileSysParm > 1 THEN _
  1215.          RETURN
  1216.       IF ZBytesInFile# < 1 THEN _
  1217.          RETURN
  1218. * INSERTING new line(s)
  1219. 20789 ZSubParm = 2                                                   ' DS090201
  1220.       CALL Line25
  1221.       ZOutTxt$ = ZFGB$ + "Estimated Transfer Time:" + _              ' DD082205
  1222.          ZFGD$ + STR$(INT(ZBlocksInFile# / 60)) + _                  ' DD082205
  1223.          ZFG3$ + " mins," +  ZFGD$ + _                               ' DD082205
  1224.          STR$(INT(ZBlocksInFile# - (INT(ZBlocksInFile# / _
  1225.          60) * 60))) + ZFG3$ + " sec" + ZEmphasizeOff$ + ZCRLf$      ' DD010301
  1226.       GOSUB 21650
  1227.       IF ZFileSysParm > 1 THEN _
  1228.          RETURN
  1229. * REPLACING old line(s) by new
  1230. * ------[ first line different ]------
  1231. 20790 CALL CheckTimeRemain (MinsRemaining)                           ' DS090201
  1232.       IF ZSubParm = -1 THEN _
  1233.          ZFileSysParm = 6 : _
  1234.          RETURN
  1235.       ZOK = ZTrue
  1236.       Temp = ZExtraDnldTime
  1237.       CALL ChkAddedTime (Temp)
  1238.       Temp = MinsRemaining + Temp
  1239.       ZWasA = INT(ZBlocksInFile# / 60) + 1
  1240.       IF ZWasA <= Temp THEN _
  1241.          GOTO 20793
  1242.       IF ZDownFiles < 2 THEN _                                       ' DS090201
  1243.          CALL AllCaps (ZFileNameHold$) : _                           ' DS090201
  1244.          ZOutTxt$ = ZFileNameHold$ + " Not enough minutes left!  Need" _
  1245.                   + STR$(ZWasA) + "  have" + STR$(Temp) : _          ' DS090201
  1246.          CALL QuickTPut1 (ZOutTxt$) : _                              ' DS090201
  1247.          IF NoTimeDnFlag THEN _                                      ' DS090201
  1248.             CALL UpdtCalr (ZOutTxt$,2)                               ' DS090201
  1249.       IF ZDownFiles < 2 THEN _
  1250.          GOTO 20791                                                  ' DS090201
  1251.       CALL OpenWork (2,ZNodeWorkFile$)                               ' DS090201
  1252.       WHILE NOT EOF(2) AND NoTimeDnFlag                              ' DS090201
  1253.             CALL ReadDir (2,1)                                       ' DS090201
  1254.             CALL BreakFileName (ZOutTxt$,DR$,ZWasY$,WasX$,ZTrue)     ' DS090201
  1255.             ZFileName$ = ZWasY$ + WasX$                              ' DS090201
  1256.             ZOutTxt$ = ZFileName$ + " Not enough minutes left!  Need" _
  1257.                        + STR$(ZWasA) + "  have" + STR$(Temp)         ' DS090201
  1258.             CALL UpdtCalr (ZOutTxt$,2)                               ' DS090201
  1259.       WEND                                                           ' DS090201
  1260.       NoTimeDnFlag = 0                                               ' DS090201
  1261.       CLOSE 2                                                        ' DS090201
  1262.       ZOutTxt$ = "Not enough minutes left!  Need"  _
  1263.                   + STR$(ZWasA) + "  have" + STR$(Temp)              ' DS090201
  1264.       CALL QuickTPut1 (ZOutTxt$)                                     ' DS090201
  1265. * REPLACING old line(s) by new
  1266. * ------[ first line different ]------
  1267. 20791 IF ZDownFiles < 2 THEN _                                       ' DS090201
  1268.          GOTO 20792
  1269.       ZLastIndex = 0
  1270.       ZOutTxt$ = "Edit files to download?" + ZYesPrompt$             ' DD060101
  1271.       ZTurboKey = - ZTurboKeyUser
  1272.       GOSUB 21668
  1273.       IF ZNo THEN _
  1274.          LastDnld = 0 : _
  1275.          GOTO 20792
  1276.       Temp = 0
  1277.       CALL OpenWork (2,ZNodeWorkFile$)
  1278.       WHILE NOT EOF(2)
  1279.          CALL ReadDir (2,1)
  1280.          CALL BreakFileName (ZOutTxt$,DR$,ZWasY$,WasX$,ZTrue)
  1281.          ZFileName$ = ZWasY$ + WasX$
  1282.          ZOutTxt$ = "Download " + ZFileName$ + CHR$(63) + ZNoPrompt$ ' DD021301
  1283.          ZTurboKey = - ZTurboKeyUser
  1284.          GOSUB 21668
  1285.          IF ZYes THEN _
  1286.             Temp = Temp + 1 : _
  1287.             ZOutTxt$(Temp) = ZFileName$
  1288.       WEND
  1289.       CLOSE 2
  1290.       ZAnsIndex = 1
  1291.       ReStart = (Temp > 0)
  1292.       LastDnld = Temp
  1293.       ZLastIndex = Temp
  1294.       FOR WasX = 1 TO Temp
  1295.          ZUserIn$(WasX) = ZOutTxt$(WasX)
  1296.       NEXT
  1297. * REPLACING old line(s) by new
  1298. 20793 IF ZRatioRestrict# > 0 THEN _
  1299. * ------[ first line different ]------
  1300.          GOSUB 21775 : _                                             ' DD040901
  1301.          IF ZFreeDnld = ZFalse THEN _                                ' DD060101
  1302.             CALL QuickTPut1 (ZEmphasizeOn$ + _                       ' DD022701
  1303.                  "RATIOS Enforced!" + ZEmphasizeOff$ + ZCRLf$ + _    ' DD022701
  1304.                  ZFGD$ + _                                           ' DD022701
  1305.                  "New statistics will be:" + ZCRLf$ + _              ' DD030502
  1306.                  ZFGE$ + STRING$(23,45) + ZEmphasizeOff$) : _        ' DD030502
  1307.          CALL CheckRatio (ZTrue)
  1308.       CALL AutoLogoff                                                ' Mpl090202
  1309.       IF ZAutoEnd = 2 THEN _                                         ' Mpl090202
  1310.          ZOK = ZFalse                                                ' Mpl090202
  1311.       RETURN
  1312. * REPLACING old line(s) by new
  1313. 20900 WasX$ = ""
  1314.       Sec = 1
  1315.       'CALL OpenOutW (ZFileName$)
  1316.       IF ZFLen > ZWriteBufDef THEN _
  1317.          WriteBuf = ZFLen _
  1318.       ELSE WriteBuf = ZWriteBufDef
  1319. * ------[ first line different ]------
  1320.       CALL OpenRSeq (2,ZFileName$,WasY,ZWasDF,WriteBuf)              ' DD031703
  1321.       IF ZErrCode <> 0 AND ZErrCode <> 53 THEN _
  1322.          ZWasEL = 20900 : _
  1323.          GOTO 21900
  1324.       FIELD #2, WriteBuf AS ZUpldRec$
  1325.       RecsWrit = 0
  1326.       NumInBuff = 0
  1327.       TransferAbort! = TIMER + ZWaitBeforeDisconnect
  1328.       Year$ = SPACE$(1) + _                                          ' DD021301
  1329.             CHR$(1) + _
  1330.             CHR$(2) + _
  1331.             ZEndTransmission$ + _
  1332.             ZCancel$
  1333. * REPLACING old line(s) by new
  1334. 21145 Sec = 255 AND (Sec + 1)
  1335. * ------[ first line different ]------
  1336.       CALL QuickLPrnt (ZFGB$ + "OK Rec Blk #" + ZFGE$,WasSO)         ' DD112003
  1337. * REPLACING old line(s) by new
  1338. 21220 IF NumInBuff < 1 THEN _
  1339.          GOTO 21225
  1340.       WasWK$ = LEFT$(ZUpldRec$,NumInBuff)
  1341. * ------[ first line different ]------
  1342.       CALL OpenRSeq (2,ZFileName$,MaxBlock,ZWasDF,128)               ' DD031703
  1343.       IF ZErrCode > 0 THEN _
  1344.          ZWasEL = 21220 : _
  1345.          GOTO 21900
  1346.       LastBlock = MaxBlock
  1347.       FIELD #2, 128 AS ZUpldRec$
  1348.       MaxBlock = CDBL(RecsWrit) * WriteBuf / 128
  1349.       FOR WasI = 1 TO NumInBuff/128
  1350.          CALL PutWork (MID$(WasWK$,128*WasI-127,128),MaxBlock,128)
  1351.          IF ZErrCode > 0 THEN _
  1352.             ZWasEL = 21220 : _
  1353.             GOTO 21900
  1354.       NEXT
  1355.       CLOSE 2
  1356. * REPLACING old line(s) by new
  1357. 21250 ZEightBit = ZTrue
  1358. * ------[ first line different ]------
  1359.       IF ZDnldCompleted AND ZAutoEnd = 1 THEN _                      ' DD120901
  1360.          ZFileSysParm = 7                                            ' DD120901
  1361.       RETURN
  1362. '
  1363. ' *  CLEAR GARBAGE OUT OF COMMUNICATIONS BUFFER
  1364. '
  1365. * REPLACING old line(s) by new
  1366. * ------[ first line different ]------
  1367. 21303 CALL OpenRSeq (2,ZFileName$,MaxBlock,ZWasDF,ZFLen)             ' DD031703
  1368.       FIELD 2,ZFLen AS ZDnldRecord$
  1369. '
  1370. ' *  ROUTINE TO START AN "Xmodem" OR "YMODEM" DOWNLOAD.  CHECK'S INITIAL
  1371. ' *  "HANDSHAKE" TO SEE IF CHARACTER IS SENT IS A:
  1372. ' *           "X" = Xmodem WITH CheckSum AND 128 CHARACTER RECORDS
  1373. ' *           "C" = Xmodem WITH CRC CHECK AND 128 CHARACTER RECORDS
  1374. ' *           "Y" = YMODEM WITH CRC CHECK AND 1024 CHARACTER RECORDS
  1375. '
  1376. * REPLACING old line(s) by new
  1377. 21380    ZCheckSum = (ZWasY$ = ZNAK$)
  1378.          IF ZCheckSum THEN _
  1379. * ------[ first line different ]------
  1380.             ZFF = INSTR(ZInternalEquiv$,CHR$(88)) : _           'X   ' DD021301
  1381.             IF ZFF > 0 THEN _
  1382.                ZWasFT$ = MID$(ZDefaultXfer$,ZFF,1) : _
  1383.                GOTO 21480 _
  1384.             ELSE ZWasFT$ = CHR$(88) : _                         'X   ' DD021301
  1385.                  GOTO 21480 _
  1386.          ELSE IF ZWasY$ = CHR$(67) THEN _                       'C   ' DD021301
  1387.                  GOTO 21480
  1388.          CALL EofComm (Char)
  1389. * REPLACING old line(s) by new
  1390. 21470 CALL QuickLPrnt (ZFGB$ + "OK Sent Blk #" + ZFGE$,WasSO)        ' DD112003
  1391. * REPLACING old line(s) by new
  1392. 21531 GOSUB 20810
  1393.       IF ZFileSysParm > 1 THEN _
  1394.          RETURN
  1395.       IF INSTR(ZWasY$,ZAcknowledge$) THEN _
  1396.          GOTO 21550
  1397.       CALL FindFKey
  1398.       IF ZSubParm < 0 THEN _
  1399.          ZFileSysParm = 2 : _
  1400.          RETURN
  1401.       IF ZKeyPressed$ = ZEscape$ THEN _
  1402.          GOSUB 21540 : _
  1403.          GOTO 21545
  1404.       IF WasX < 10 THEN _
  1405.          WasX = WasX + 1 : _
  1406.          GOTO 21531
  1407. * ------[ first line different ]------
  1408.       ZDnldCompleted = ZFalse                                        ' DD120901
  1409.       GOTO 21230
  1410. * REPLACING old line(s) by new
  1411. 21545 ZWasY$ = ZCancel$
  1412.       CALL PutCom (ZCancel$ + ZCancel$ + ZCancel$)
  1413. * ------[ first line different ]------
  1414.       ZDnldCompleted = ZFalse                                        ' DD120901
  1415.       GOTO 21250
  1416. * REPLACING old line(s) by new
  1417. * ------[ first line different ]------
  1418. 21550 ZDnldCompleted = ZTrue                                         ' DD120901
  1419.       GOTO 21250
  1420. * REPLACING old line(s) by new
  1421. * ------[ first line different ]------
  1422. 21561 ZDnldCompleted = ZFalse                                        ' DD120901
  1423.       WasD$ = ZLineFeed$ + _
  1424.            "Caller aborted trans"
  1425.       GOSUB 21710
  1426.       IF ZFileSysParm > 1 THEN _
  1427.          RETURN
  1428.       GOTO 21545
  1429. '
  1430. ' STANDARD ENTRY FOR RBBS-PC'S COMMON TERMINAL OUTPUT ROUTINE
  1431. '
  1432. ' Modeled on lines 12975 to 12983 in RBBS-PC.BAS
  1433. * REPLACING old line(s) by new
  1434. 21760 GOSUB 21780
  1435.       IF ZFileSysParm > 1 THEN _
  1436.          RETURN
  1437.       IF ZBatchTransfer THEN _
  1438.          CALL LinesInFile (ZNodeWorkFile$,ZDownFiles) _
  1439.       ELSE ZDownFiles = 1
  1440. * ------[ first line different ]------
  1441.       ZMenuDownloads = ZMenuDownloads + ZDownFiles                   ' DD090901/MENU0
  1442.       IF NOT ZDnldCompleted THEN _                                   'Pe 05/31/91
  1443.          ZAutoLogoffReq = ZFalse : _
  1444.          ZWasDF$ = " Aborted" : _
  1445.          GOTO 21770                                                  ' Mpl090202
  1446.       CALL LogPDown (ZPersonalDnld,1+ZAnsIndex-FirstDnld)
  1447.       GOSUB 21775                                                    ' DD040901
  1448.       WasX = ((ZRatioRestrict# > 0) AND ZEnforceRatios AND ZFreeDnld)
  1449.       IF NOT WasX THEN _
  1450.          ZDnlds = ZDnlds + ZDownFiles : _
  1451.          ZGlobalDLToday! = ZGlobalDLToday! + ZDownFiles : _
  1452.          ZGlobalDnlds = ZGlobalDnlds + ZDownFiles : _
  1453.          ZDLBytes! = ZDLBytes! + ZNumDnldBytes! : _
  1454.          ZGlobalDLBytes! = ZGlobalDLBytes! + ZNumDnldBytes! : _
  1455.          ZDLToday! = ZDLToday! + ZDownFiles : _
  1456.          ZBytesToday! = ZBytesToday! + ZNumDnldBytes! : _
  1457.          ZGlobalBytesToday! = ZGlobalBytesToday! + ZNumDnldBytes!
  1458.       ZNumDnldBytes! = 0
  1459. '     CALL Muzak (6)                                                 ' DD062502
  1460.       ZWasDF$ = " Downloaded"
  1461.       IF (ZAnsIndex = LastDnld OR NOT ZConcatFIles) THEN _
  1462.          CALL SkipLine (1) : _
  1463.          CALL QuickTPut1 (ZFGE$ + "Download(s) successful" + _       ' DD081402
  1464.               ZEmphasizeOff$)                                        ' DD081402
  1465.          IF WasX THEN _
  1466.             CALL QuickTPut1 (ZFGA$ + "but not counted against " + _  ' DD082301
  1467.                  "ratios" + ZEmphasizeOff$)                          ' DD082301
  1468. '21768 IF ZAutoDownInProgress THEN _                                 ' DD062304
  1469. '        ZWasDF$ = " AUTO" + _                                       ' Mpl090202
  1470. '             MID$(ZWasN$,2)                                         ' Mpl090202
  1471. '     IF INSTR(ZWasN$,"Aborted") THEN _                              ' Mpl090202
  1472. '        ZAutoDownInProgress = 0                                     ' Mpl090202
  1473. '     ZOutTxt$ = ""                                                  ' Mpl090202
  1474. * DELETING old line(s)
  1475. 21768
  1476. * REPLACING old line(s) by new
  1477. * ------[ first line different ]------
  1478. 21773 IF ZTransferFunction = 1 THEN                                  ' Mpl090202
  1479.       CALL BreakFileName (ZFileName$,DR$,WasX$,Extension$,ZTrue)
  1480.       ZWasZ$ = WasX$ + _
  1481.            Extension$ + _
  1482.            ZWasDF$ + _
  1483.            " at " + _
  1484.            ZTime$ + _
  1485.            " using " + _
  1486.            ZWasFT$ + _
  1487.            STR$(ZBytesInFile#)
  1488.          CALL UpdtCalr (ZWasZ$,2)
  1489.       END IF                                                         ' Mpl090202
  1490.       IF ZBatchTransfer THEN _
  1491.          ZWasQ = ZWasQ - 1 : _
  1492.          GOTO 21772
  1493.       'CALL CheckRatio (ZFalse)
  1494. '21774 IF ZMenuIndex = 6 THEN _                                      ' DD062304
  1495. '        IF DnldCompleted THEN _                                     ' Mpl090202
  1496. '           ZOutTxt$ = WasX$ : _                                     ' Mpl090202
  1497. '           ZSubParm = 5 : _                                         ' Mpl090202
  1498. '           CALL Library                                             ' Mpl090202
  1499.       RETURN
  1500. * DELETING old line(s)
  1501. 21774
  1502. * INSERTING new line(s)
  1503. 21775 TmpName$ = ZDirPath$ + "FREE.DEF"                              ' DD040901
  1504.       TempZOK = ZOK                                                  ' DD043001
  1505.       CALL FindIt (TmpName$)                                         ' DD040901
  1506.       IF ZOK THEN                                                    ' DD040901
  1507.          CALL OpenWork (2, TmpName$)                                 ' DD040901
  1508.          HaveFile$ = ""                                              ' DD040901
  1509.          FileIsFree = ZFalse                                         ' DD040901
  1510.          WHILE NOT EOF(2) AND NOT FileIsFree                         ' DD040901
  1511.             INPUT #2, FreeFile$                                      ' DD040901
  1512.             CALL AllCaps (FreeFile$)                                 ' DD040901
  1513.             FileIsFree = (INSTR(LEFT$(ZFileNameHold$,LEN(FreeFile$)),FreeFile$) > 0) ' DD040901
  1514.          WEND                                                        ' DD040901
  1515.          CLOSE 2                                                     ' DD040901
  1516.          IF FileIsFree THEN                                          ' DD040901
  1517.             ZFreeDnld = ZTrue                                        ' DD040901
  1518.          END IF                                                      ' DD040901
  1519.       END IF                                                         ' DD040901
  1520.       ZOK = TempZOK                                                  ' DD043001
  1521.       RETURN                                                         ' DD040901
  1522. '
  1523. '
  1524. ' *****   TURN ON INTERMEDIATE ECHO   ****
  1525. '
  1526. '  (formerly line 50620 in RBBS-PC.BAS
  1527. * REPLACING old line(s) by new
  1528. * ------[ first line different ]------
  1529. 21780 IF ZEchoer$ = CHR$(73) THEN _                             'I   ' DD021301
  1530.          CALL SetEcho (CHR$(73))                                     ' DD021301
  1531. '
  1532. ' *  RESTORE COMMUNICATIONS AFTER Switch TO 8 BIT
  1533. '
  1534. '  (formerly between lines 50620 and 50630 in RBBS-PC.BAS
  1535.       IF SwitchToEight THEN _
  1536.          IF ZSwitchBack THEN _
  1537.             OUT ZLineCntlReg, PrevLineCntl : _
  1538.             CALL DelayTime (3) : _
  1539.             ZEightBit = ZFalse : _
  1540.             SwitchToEight = ZFalse
  1541.       RETURN
  1542. '
  1543. ' *****  TURN OFF INTERMEDIATE ECHO  ****
  1544. '
  1545. '  (formerly line 50630 in RBBS-PC.BAS
  1546. * REPLACING old line(s) by new
  1547. * ------[ first line different ]------
  1548. 21790 Call CheckCarrier                                              'Pe 12/31/91
  1549.       IF ZSubParm = -1 THEN _                                        'Pe 12/31/91
  1550.          ZFileSysParm = 7 : _                                        'Pe 12/31/91
  1551.       RETURN                                                         'Pe 12/31/91
  1552.       IF ZEchoer$ = CHR$(73) THEN _                             'I   ' DD021301
  1553.          CALL SetEcho (CHR$(82))                                'R   ' DD021301
  1554.       RETURN
  1555. '
  1556. ' *****   DIRECTORY SEARCH   ****
  1557. '
  1558. '  (formerly lines 52900 to 52920 in RBBS-PC.BAS
  1559. * REPLACING old line(s) by new
  1560. * ------[ first line different ]------
  1561. 21810 ZOutTxt$ = "Search string or filename (wildcards OK)" + _      ' DD021301
  1562.                  ZPressEnterExpert$                                  ' DD021301
  1563.       ZMacroMin = 99
  1564.       GOSUB 21668
  1565.       IF ZWasQ = 0 THEN _
  1566.          RETURN
  1567. * REPLACING old line(s) by new
  1568. 21820 WasRS$ = ZUserIn$(ZAnsIndex)
  1569. * ------[ first line different ]------
  1570.       WildSearch = (INSTR(WasRS$,CHR$(42)) > 0 OR INSTR(WasRS$,CHR$(63)) > 0) ' DD021301
  1571.       CALL AllCaps (WasRS$)
  1572.       IF RIGHT$(WasRS$,1) = CHR$(42) THEN _                     '*   ' DD021301
  1573.          IF RIGHT$(WasRS$,2) <> ".*" THEN _
  1574.             WasRS$ = WasRS$ + ".*"
  1575.       SearchString$ = WasRS$
  1576.       SearchDate$ = ""
  1577.       ZJumpSearching = ZFalse
  1578.       WasA1$ = WasRS$
  1579. '     ZExtendedOff = ZFalse                                          ' DD062901
  1580.       GOTO 21867
  1581. '
  1582. ' *****  P - personal download  ****
  1583. '
  1584. '  (formerly lines 52950 to 52952 in RBBS-PC.BAS
  1585. * REPLACING old line(s) by new
  1586. 21850 IF ZPersonalBegin < 1 OR ZPersonalLen < 1 THEN _
  1587.          RETURN
  1588. * ------[ first line different ]------
  1589.       IF NOT ZExpertUser THEN _                                      ' DD031401
  1590.          FileName$ = ZWelcomeFileDrvPath$ + "P.MNU" : _              ' DD040808
  1591.          CALL Graphic (FileName$) : _                                ' DD031404
  1592.          CALL BufFile (FileName$,WasX)                               ' DD031404
  1593.       DnldFlag = 0
  1594.       ZPersonalDnld = ZTrue
  1595. * REPLACING old line(s) by new
  1596. 21854 'ZPersonalDnld = ZFalse
  1597.       'ZListOnly = ZFalse
  1598. * ------[ first line different ]------
  1599.       ZActiveFMSDir$ = ""                                            ' DD040803
  1600.       CALL OpenFMS (LastRec,WasL)                                    ' DD040803
  1601.       RETURN
  1602. '
  1603. ' *  WasN - COMMAND FROM FILES MENU (DISPLAY NEW FILES SINCE Last DIR DISPLAY)
  1604. '
  1605. '  (formerly lines 53000 to 53070 in RBBS-PC.BAS
  1606. * REPLACING old line(s) by new
  1607. 21862 WasA1$ = RIGHT$(ZWasLM$,4) +_
  1608.             LEFT$(ZWasLM$,2)
  1609.       ZOutTxt$ = "Files on/after MMDDYY, [S]ince = " + WasA1$
  1610.       GOSUB 21668
  1611.       CALL AraAllCaps (ZUserIn$(),ZAnsIndex)
  1612. * ------[ first line different ]------
  1613.       IF ZWasQ = 0 OR ZUserIn$(ZAnsIndex) = CHR$(83) THEN _     'S   ' DD021301
  1614.          WasRS$ = ZWasLM$ : _
  1615.          GOTO 21866
  1616. * REPLACING old line(s) by new
  1617. 21866 SearchDate$ = WasRS$
  1618. * ------[ first line different ]------
  1619.  
  1620. 'No new files found mod -------------------------------------------------------
  1621. 'don't work yet :(
  1622. '      TempDate$ = LEFT$(RIGHT$(SearchDate$,4),2) + "-" + _           ' DD090704
  1623. '                  RIGHT$(SearchDate$,2) + _                          ' DD090704
  1624. '                  "-" + LEFT$(SearchDate$,2) + SPACE$(1) + "00:00"   ' DD021301
  1625. '      CALL CountNewFiles (TempDate$,ZMsgPtr(),NewFileCount,"")       ' DD090704
  1626. '      IF NewFileCount < 1 THEN                                       ' DD090704
  1627. '         CALL QuickTPut1 (ZCRLf$ + ZFGF$ + ZBG5$ + _                 ' DD090704
  1628. '                          "No New Files since " + _                  ' DD090704
  1629. '                          LEFT$(TempDate$,8) + "!" + _               ' DD090704
  1630. '                          ZEmphasizeOff$ + ZCRLf$)                   ' DD090704
  1631. '         IF NOT ZExpertUser THEN _                                   ' DD090704
  1632. '            CALL AskMore ("",ZTrue,ZFalse,WasX,ZTrue)                ' DD090704
  1633. '         RETURN
  1634. '      END IF                                                         ' DD090704
  1635.  
  1636. 'end of mod -------------------------------------------------------------------
  1637.  
  1638.       SearchString$ = ""
  1639.       ZJumpSearching = ZFalse
  1640. '     ZExtendedOff = ZFalse                                          ' DD062901
  1641.       ZUserIn$(ZAnsIndex) = CHR$(65)                            'A   ' DD021301
  1642.       ZEndList = ZTrue                                               'Pe 12/01/91
  1643.       GOTO 21871                                                     'Pe NewFile mod
  1644. * REPLACING old line(s) by new
  1645. * ------[ first line different ]------
  1646. 21867 CALL GetDirs (ZFalse)                                          ' Mpl090202
  1647.       IF ZWasQ = 0 THEN _
  1648.          RETURN
  1649. * REPLACING old line(s) by new
  1650. 21880 WasQX = ZAnsIndex
  1651.       GOSUB 20157
  1652.       IF ZFileSysParm > 1 THEN _
  1653.          RETURN
  1654.       ZAnsIndex = ZAnsIndex + 1
  1655.       IF ZAnsIndex <= ZLastIndex THEN _
  1656.          GOTO 21875
  1657.       ListNew = ZFalse
  1658. * ------[ first line different ]------
  1659.       ZEndList = ZFalse                                              'Pe 12/01/91
  1660.       SearchString$ = ""
  1661.       SearchDate$ = ""
  1662.       RETURN
  1663. * REPLACING old line(s) by new
  1664. 21900 IF ZDebug THEN _
  1665.          ZOutTxt$ = "RBBSSUB5 DEBUG Error Trap Entry ERL=" + _
  1666.               STR$(ZWasEL) + _
  1667.               " ERR=" + _
  1668.               STR$(ZErrCode) : _
  1669.          IF ZPrinter THEN _
  1670.             CALL Printit(ZOutTxt$) _
  1671.          ELSE CALL LPrnt(ZOutTxt$,1)
  1672.       IF ZWasEL = 20126 AND ZErrCode = 53 THEN _
  1673.          GOTO 20142
  1674.       IF ZWasEL = 20242 AND ZErrCode = 62 THEN _
  1675.          CALL UpdtCalr (ZFileSecFile$ + " bad format!",2) : _
  1676.          GOTO 20247
  1677.       IF ZWasEL = 20263 THEN _
  1678.          ZOutTxt$ = "<Download aborted>" : _
  1679. * ------[ first line different ]------
  1680.          ZDnldCompleted = ZFalse : _                                 ' Mpl090202
  1681.          GOTO 20390
  1682.       IF ZWasEL = 20560 AND ZErrCode = 67 THEN _
  1683.          GOTO 20451
  1684.       IF ZWasEL = 20560 AND ZErrCode = 70 THEN _
  1685.          IF VAL(ZFreeSpace$) > 1999 THEN _
  1686.             GOTO 20610 _
  1687.          ELSE GOSUB 21895 : _
  1688.               GOTO 21700
  1689.       IF ZWasEL = 20620 THEN _
  1690.          GOTO 20670
  1691.       IF ZWasEL = 20650 THEN _
  1692.          GOTO 20670
  1693.       IF ZWasEL = 20736 AND ZErrCode = 53 THEN _
  1694.          GOTO 21700
  1695. '     IF ZWasEL = 20900 AND ZErrCode = 75 THEN _                     ' Mpl090202
  1696. '        GOTO 21230                                                  ' Mpl090202
  1697. '     IF ZWasEL = 20900 AND ZErrCode = 70 THEN _                     ' Mpl090202
  1698. '        GOSUB 21895 : _                                             ' Mpl090202
  1699. '        GOTO 21230                                                  ' Mpl090202
  1700. '     IF ZWasEL = 21131 OR ZWasEL = 21220 THEN _                     ' Mpl090202
  1701. '        ZErrCode = 0 : _                                            ' Mpl090202
  1702. '        GOTO 21230                                                  ' Mpl090202
  1703. '     IF ZWasEL = 21480 THEN _                                       ' Mpl090202
  1704. '        CALL LogError : _                                           ' Mpl090202
  1705. '        IF ZErrCode = 57 THEN _                                     ' Mpl090202
  1706. '           CALL QuickTPut1 ("Error reading file.  Aborting download") : _' Mpl090202
  1707. '           DnldCompleted = ZFalse : _                               ' Mpl090202
  1708. '           GOTO 21230                                               ' Mpl090202
  1709. * INSERTING new line(s)
  1710. 21930 '$SUBTITLE: ' FILSECCHK - New FILESEC SubRoutine for VIEW and DOWNLOADED '
  1711. ' $PAGE
  1712. '
  1713. '  NAME    -- FilSecChk
  1714. '
  1715. '  INPUTS  -- PARAMETER                      MEANING
  1716. '             ZViolation$                String for type of action
  1717. '                                        "Download" or "View"
  1718. '             ZWasZ$                     Path/Filename of File being checked
  1719. '
  1720. '
  1721. '  OUTPUTS -- NoViolation                Passed or Failed FILESEC Check
  1722. '                                        (True)    (False)
  1723. '
  1724. '  PURPOSE -- To enable FILESEC to be check for downloads and
  1725. '             file viewing
  1726. '
  1727.       SUB FilSecChk (ZViolation$, ZWasZ$, NoViolation) STATIC        ' DGS-DS/TH
  1728.       NoViolation = ZTrue                                            ' DGS-DS/TH
  1729.       CALL OpenWork (2,ZFileSecFile$)                                ' DGS-DS/TH
  1730.       IF ZErrCode = 53 THEN _                                        ' DGS-DS/TH
  1731.          EXIT SUB                                                    ' DGS-DS/TH
  1732. 21940 IF EOF(2) THEN _                                               ' DGS-DS/TH
  1733.          EXIT SUB                                                    ' DGS-DS/TH
  1734.       CALL ReadParms (ZWorkAra$(),3,1)                               ' DGS-DS/TH
  1735.       IF ZErrCode <> 0 THEN _                                        ' DGS-DS/TH
  1736.          EXIT SUB                                                    ' DGS-DS/TH
  1737. 21950 CALL WildFile (ZWorkAra$(1),ZWasZ$,ZOK)                        ' DGS-DS/TH
  1738.       IF NOT ZOK THEN _                                              ' DGS-DS/TH
  1739.          NoViolation = ZTrue : _                                     ' DGS-DS/TH
  1740.          GOTO 21940                                                  ' DGS-DS/TH
  1741. 21960 IF ZUserSecLevel < VAL(ZWorkAra$(2)) THEN _                    ' DGS-DS/TH
  1742.          GOTO 21970                                                  ' DGS-DS/TH
  1743.       FilePswd$ = ZWorkAra$(3)                                       ' DGS-DS/TH
  1744.       IF FilePswd$ = "" THEN _                                       ' DGS-DS/TH
  1745.          EXIT SUB                                                    ' DGS-DS/TH
  1746.       CALL AllCaps (FilePswd$)                                       ' DGS-DS/TH
  1747.       IF FilePswd$ = ZPswd$ THEN _                                   ' DGS-DS/TH
  1748.          EXIT SUB                                                    ' DGS-DS/TH
  1749.       ZOutTxt$ = "Enter PASSWORD to download " + _                   ' DGS-DS/TH
  1750.            ZFileName$                                                ' DGS-DS/TH
  1751.       ZSubParm = 1                                                   ' DGS-DS/TH
  1752.       CALL TGet                                                      ' DGS-DS/TH
  1753.       IF ZFileSysParm > 1 THEN _                                     ' DGS-DS/TH
  1754.          EXIT SUB                                                    ' DGS-DS/TH
  1755.       IF ZWasQ = 0 THEN _                                            ' DGS-DS/TH
  1756.          EXIT SUB                                                    ' DGS-DS/TH
  1757.       CALL AraAllCaps (ZUserIn$(),1)                                 ' DGS-DS/TH
  1758.       IF ZUserIn$(1) = FilePswd$ THEN _                              ' DGS-DS/TH
  1759.          EXIT SUB                                                    ' DGS-DS/TH
  1760. 21970 NoViolation = ZFalse                                           ' DGS-DS/TH
  1761. 21980 IF ZViolation$ = "View ARC" OR ZViolation$ = "TYPE file" THEN _' DD040101
  1762.          ZViolation$ = ZViolation$ + " " + ZFileName$ : _            ' DD040101
  1763.       Call QuickTPut1 (ZFGE$ + ZBG4$ + " Protected File! " + _       ' DD092502
  1764.                        ZEmphasizeOff$)                               ' DD092502
  1765.       EXIT SUB                                                       ' DGS-DS/TH
  1766.       END SUB                                                        ' DGS-DS/TH
  1767. '                                                                    ' DD040101
  1768. 22000 SUB PersFilSecChk (ZViolation$, SearchFile$, NoViolation) STATIC ' DD040101
  1769.       CALL BreakFileName (SearchFile$,Pre$,Body$,Ext$,ZTrue)         ' DD040101
  1770.       NoViolation = ZTrue                                            ' DD040101
  1771.       FSize = 12 + 21 + ZMaxDescLen + ZPersonalLen + 1 + 2           ' DD040101
  1772.       CALL OpenRSeq (2,ZPersonalDir$,HighRec,WasX,FSize)             ' DD040101
  1773.       FIELD 2, 12 AS FileName$, _                                    ' DD040101
  1774.                21 + ZMaxDescLen AS FileDesc$, _                      ' DD040101
  1775.                ZPersonalLen + 1 AS FilePers$, _                      ' DD040101
  1776.                 2 AS FileChar$                                       ' DD040101
  1777.       Match = ZFalse                                                 ' DD040101
  1778.       Count = 1                                                      ' DD040101
  1779.       WHILE NOT EOF(2)                                               ' DD040101
  1780.          GET 2, Count                                                ' DD040101
  1781.          IF LEFT$(FileName$,LEN(Body$+Ext$)) = Body$ + Ext$ THEN     ' DD040101
  1782.             Match = ZTrue                                            ' DD040101
  1783.                CALL CheckInt (FilePers$)                             ' DD040101
  1784.                IF (ZTestedIntValue > 0 AND _                         ' DD040101
  1785.                   ZUserSecLevel >= ZTestedIntValue) OR _             ' DD040101
  1786.                   LEFT$(FilePers$,LEN(ZActiveUserName$)) = _         ' DD040101
  1787.                   ZActiveUserName$ THEN                              ' DD040101
  1788.                      NoViolation = ZTrue                             ' DD040101
  1789.                      EXIT SUB                                        ' DD040101
  1790.                   END IF                                             ' DD040101
  1791.          END IF                                                      ' DD040101
  1792.          Count = Count + 1                                           ' DD040101
  1793.       WEND                                                           ' DD040101
  1794. 22010 IF Match = ZTrue THEN                                          ' DD040101
  1795.          NoViolation = ZFalse                                        ' DD040101
  1796.          IF ZViolation$ = "View ARC" OR ZViolation$ = "TYPE file" THEN _' DD040101
  1797.             ZViolation$ = ZViolation$ + " " + ZFileName$ : _         ' DD040101
  1798.          Call QuickTPut1 (ZFGE$ + ZBG4$ + " Protected File! " + _    ' DD040101
  1799.                           ZEmphasizeOff$)                            ' DD040101
  1800.       END IF                                                         ' DD040101
  1801.       END SUB                                                        ' DD040101
  1802. * REPLACING old line(s) by new
  1803. 63100 ' $SUBTITLE: 'DoorReturn - Subroutine to process requests from a door'
  1804. ' $PAGE
  1805. '
  1806. '  NAME    -- DoorReturn
  1807. '
  1808. '  INPUTS  -- PARAMETER                      MEANING
  1809. '             DOUTx.DEF               File of requests
  1810. '
  1811. '  OUTPUTS -- ZUserSecLevel     Revised Security Level
  1812. '
  1813. '  PURPOSE -- To give Doors a stable way to make requests
  1814. '             to the host.
  1815. '
  1816.       SUB DoorReturn STATIC
  1817.       IF NOT ZExitToDoors THEN _
  1818.          EXIT SUB
  1819.       CALL OpenUser (ZHighestUserRecord)
  1820.       FIELD 5, 128 AS ZUserRecord$
  1821.       FIELD 5,31 AS ZUserName$, _
  1822.               15 AS ZPswd$, _
  1823.                2 AS ZSecLevel$, _
  1824.               14 AS ZUserOption$,  _
  1825.               24 AS ZCityState$, _
  1826. * ------[ first line different ]------
  1827.                1 AS MachineType$, _                                  ' DD091401/DROP
  1828.                1 AS ZDropTimes$, _                                   ' DD091401/DROP
  1829.                1 AS ZBankTime$,_
  1830.                4 AS ZTodayDl$, _
  1831.                4 AS ZTodayBytes$, _
  1832.                4 AS ZDlBytes$, _
  1833.                4 AS ZULBytes$, _
  1834.               14 AS ZLastDateTimeOn$, _
  1835.                3 AS ZListNewDate$, _
  1836.                2 AS ZUserDnlds$, _
  1837.                2 AS ZUserUplds$, _
  1838.                2 AS ZElapsedTime$
  1839.       ZSubParm = 6
  1840.       CALL FileLock
  1841.       GET 5,ZUserFileIndex
  1842.       ZTimesLoggedOn = CVI(MID$(ZUserOption$,1,2))
  1843.       IF ZDoorDropFile$ = CHR$(82) THEN _                       'R   ' DD021301
  1844.          CALL ReadDoorSys                                            ' DD012702
  1845.       GOSUB 63198                                                    ' DD041006
  1846.       ZElapsedTime = CVI(MID$(ZUserRecord$,127,2))
  1847.       IF ZDoorDropFile$ = CHR$(82) THEN _                       'R   ' DD021301
  1848.          ZErrCode = 0 : _                                            ' DD012702
  1849.          PUT 5,ZUserFileIndex                                        ' DD012702
  1850.       ZFileName$ = "DOUT" + ZNodeID$ + ".DEF"
  1851.       CALL FindIt (ZFileName$)
  1852.       IF NOT ZOK THEN _
  1853.          GOTO 63197
  1854. * REPLACING old line(s) by new
  1855. 63105 IF EOF(2) THEN _
  1856.          GOTO 63195
  1857.       CALL ReadParms (ZOutTxt$(),2,1)
  1858.       IF ZErrCode > 0 THEN _
  1859.          GOTO 63115
  1860.       IF LEN(ZOutTxt$(1)) < 2 THEN _
  1861.          GOTO 63105
  1862. * ------[ first line different ]------
  1863.       ZUserIn$ = LEFT$(ZOutTxt$(1),2) + CHR$(44)                ',   ' DD021301
  1864.       WasX = INSTR("SL,UR,",ZUserIn$)
  1865.       IF WasX = 0 THEN _
  1866.          GOTO 63105
  1867.       WasX = WasX\3 + 1
  1868.       ON WasX GOTO 63110,63115
  1869.       GOTO 63105
  1870. * REPLACING old line(s) by new
  1871. 63110 WasX$ = LEFT$(ZOutTxt$(2),1)         ' ZWasSL = Security Level
  1872.       CALL CheckInt (ZOutTxt$(2))
  1873.       IF ZErrCode > 0 THEN _
  1874.          GOTO 63105
  1875. * ------[ first line different ]------
  1876.       IF WasX$ = CHR$(43) OR WasX$ = CHR$(45) THEN _                 ' DD021301
  1877.          ZWasA = ZUserSecLevel + ZTestedIntValue _
  1878.       ELSE ZWasA = ZTestedIntValue
  1879.       IF ZWasA < ZSysopSecLevel THEN _
  1880.          ZAdjustedSecurity = (ZWasA <> ZUserSecLevel) : _
  1881.          IF ZAdjustedSecurity THEN _
  1882.             ZUserSecLevel = ZWasA : _
  1883.             MID$(ZUserRecord$,47,2) = MKI$(ZWasA) : _
  1884.             CALL QuickTPut1 ("Door changed Security to " + STR$(ZWasA)) : _' DD091702
  1885.             CALL UpdtCalr ("Door reset security to "+STR$(ZWasA),2)
  1886.       GOTO 63105
  1887. * REPLACING old line(s) by new
  1888. 63115 IF LEN(ZOutTxt$(1)) < 7 THEN _
  1889.          GOTO 63105
  1890. * ------[ first line different ]------
  1891.       IF MID$(ZOutTxt$(1),3,1) <> CHR$(40) THEN _               '(   ' DD021301
  1892.          GOTO 63105
  1893.       WasX = INSTR(4,ZOutTxt$(1),CHR$(58))                      ':   ' DD021301
  1894.       IF WasX < 1 THEN _
  1895.          GOTO 63105
  1896.       CALL CheckInt (MID$(ZOutTxt$(1),4,WasX-4))
  1897.       IF ZErrCode > 0 THEN _
  1898.          GOTO 63105
  1899.       IF ZTestedIntValue > 128 OR ZTestedIntValue < 1 THEN _
  1900.          GOTO 63105
  1901.       ZWasA = ZTestedIntValue
  1902.       CALL CheckInt (MID$(ZOutTxt$(1),WasX+1))
  1903.       IF ZErrCode > 0 OR ZTestedIntValue < 1 OR ZTestedIntValue > 128 THEN _
  1904.          GOTO 63105
  1905.       MID$(ZUserRecord$,ZWasA,ZTestedIntValue) = LEFT$(ZOutTxt$(2) + _
  1906.          SPACE$(ZTestedIntValue),ZTestedIntValue)
  1907.       CALL UpdtCalr ("Door set UR"+STR$(ZWasA)+CHR$(58)+STR$(ZTestedIntValue)+" to <"+ZOutTxt$(2)+CHR$(62),2) ' DD021301
  1908.       GOTO 63105
  1909. * REPLACING old line(s) by new
  1910. 63195 CALL KillWork (ZFileName$)
  1911. * ------[ first line different ]------
  1912.       GOSUB 63198                                                    ' DD041006
  1913.       ZErrCode = 0
  1914.       PUT 5,ZUserFileIndex
  1915. * REPLACING old line(s) by new
  1916. 63197 ZSubParm = 8
  1917.       CALL FileLock
  1918. * ------[ first line different ]------
  1919.       EXIT SUB                                                       ' DD041006
  1920. * INSERTING new line(s)
  1921. 63198 CALL SetSysOp                                                  ' DD041006
  1922.       CALL SetUserPref                                               ' DD041006
  1923.       CALL SetUserUpDn                                               ' DD041006
  1924.       ZGlobalsSet = ZFalse                                           ' DD041006
  1925.       CALL SetGlobalUpDn                                             ' DD041006
  1926.       RETURN                                                         ' DD041006
  1927.       END SUB
  1928. * REPLACING old line(s) by new
  1929. 63286 PatPos = PatPos + Inc
  1930.       StrPos = StrPos + Inc
  1931.       WasKT = WasKT + 1
  1932.       IF WasKT > WasL THEN _
  1933.          GOTO 63288
  1934.       ZUserIn$ = MID$(Pattern$,PatPos,1)
  1935. * ------[ first line different ]------
  1936.       IF ZUserIn$ = CHR$(42) THEN _                             '*   ' DD021301
  1937.          GOTO 63289
  1938. * REPLACING old line(s) by new
  1939. * ------[ first line different ]------
  1940. 63287 IF MID$(Strng$,StrPos,1) <> ZUserIn$ THEN _                    ' DD032601
  1941.          ZOK = ZFalse : _
  1942.          EXIT SUB
  1943.       GOTO 63286
  1944. * REPLACING old line(s) by new
  1945. 63288 IF PatPos >= LEN(Pattern$) OR PatPos < 1 THEN _
  1946.          EXIT SUB
  1947. * ------[ first line different ]------
  1948.       IF MID$(Pattern$,PatPos,1) <> CHR$(42) THEN _             '*   ' DD021301
  1949.          ZOK = ZFalse : _
  1950.          EXIT SUB
  1951. * REPLACING old line(s) by new
  1952. 63300 ' $SUBTITLE: 'BreakFileName - sub to split file name into components'
  1953. ' $PAGE
  1954. '
  1955. '  NAME    -- BreakFileName
  1956. '
  1957. '  INPUTS  -- PARAMETER                    MEANING
  1958. '             FileSpec$        FULL NAME OF FILE
  1959. '             ForJoining       True IF WANT PARTS FORMATTED FOR
  1960. '                                           FORMING FILE NAMES
  1961. '  OUTPUTS -- DrvPath$         DRIVE AND PATH
  1962. '             Prefix$          PREFIX OF FILE NAME
  1963. '             Extension$       EXTENSION OF FILE NAME
  1964. '
  1965. ' (E.G. "C:\RBBS\ARCE.COM" HAS "C:\RBBS" AS DRIVE AND PATH,
  1966. '                              "ARCE"    AS PREFIX OF THE FILE NAME, AND
  1967. '                              "COM"     AS THE EXTENSION OF THE FILE NAME.
  1968. '
  1969. ' JOINED FORMAT IS C:\RBBS\,ARCE,.COM
  1970. '
  1971. '  PURPOSE -- To break a file name into its component parts
  1972. '             of drive/path, prefix, and extension
  1973. '
  1974. '
  1975.       SUB BreakFileName (PassedFileSpec$,DrvPath$,Prefix$,Extension$,ForJoining) STATIC
  1976.       FileSpec$ = PassedFileSpec$
  1977.       CALL AllCaps (FileSpec$)
  1978.       DrvPath$ = ""
  1979.       Prefix$ = ""
  1980.       Extension$ = ""
  1981.       WasL = LEN(FileSpec$)
  1982.       IF WasL < 1 THEN _
  1983.          EXIT SUB
  1984. * ------[ first line different ]------
  1985.       CALL FindLast (FileSpec$,CHR$(92),WasX,WasY)              '\   ' DD021301
  1986.       IF WasX < 1 THEN _
  1987.          IF MID$(FileSpec$,2,1) = CHR$(58) THEN _               ':   ' DD021301
  1988.             DrvPath$ = LEFT$(FileSpec$,2) : _
  1989.             ZWasS = 3 _
  1990.          ELSE ZWasS = 1 _
  1991.       ELSE DrvPath$ = LEFT$(FileSpec$,WasX) : _
  1992.            ZWasS = WasX + 1
  1993.       WasX = INSTR(ZWasS,FileSpec$ + CHR$(46),CHR$(46))         '.   ' DD021301
  1994.       IF WasX < WasL THEN _
  1995.          Extension$ = MID$(FileSpec$,WasX)
  1996.       IF ZWasS <= WasL THEN _
  1997.          IF WasX >= ZWasS THEN _
  1998.             Prefix$ = MID$(FileSpec$,ZWasS,WasX - ZWasS)
  1999.       IF ForJoining THEN _
  2000.          EXIT SUB
  2001.       IF WasY > 1 THEN _
  2002.          DrvPath$ = LEFT$(DrvPath$, LEN(DrvPath$) - 1)
  2003.       IF LEN(Extension$) > 0 THEN _
  2004.          Extension$ = MID$(Extension$, 2)
  2005.       END SUB
  2006. * REPLACING old line(s) by new
  2007. 63320 ' $SUBTITLE: 'ShellExit - sub to shell out from RBBS'
  2008. ' $PAGE
  2009. '
  2010. '  NAME    -- ShellExit
  2011. '
  2012. '  INPUTS  -- ShellTem$     String to invoke shell with
  2013. '
  2014. '  OUTPUTS -- none
  2015. '
  2016. '  PURPOSE -- Delay so that strings can finish printing.  Restore comm
  2017. '             port on return
  2018. '
  2019.       SUB ShellExit (ShellTem$) STATIC
  2020. * ------[ first line different ]------
  2021.       CALL DelayTime (4 + ZBPS)                                      'Pe 08/12/91
  2022.       IF NOT ZLocalUser THEN _
  2023.          IF ZFossil THEN _
  2024.             CALL FOSExit(ZComPort) _
  2025.          ELSE CLOSE 3 : _
  2026.               OUT ZModemCntlReg,INP(ZModemCntlReg) OR 1
  2027.       IF ZFunctionKey <> 2 THEN                                      ' DD051301
  2028.          CLOSE 2                                                     ' DD041005
  2029.       END IF                                                         ' DD041005
  2030.       CALL MetaGSR (ShellTem$,ZFalse)
  2031.       SHELL ShellTem$
  2032.       IF ZFossil THEN _
  2033.          IF NOT ZLocalUser THEN _
  2034.             CALL FOSinit(ZComPort,Result) : _
  2035.             IF Result = -1 THEN _
  2036.                CALL PScrn("ERROR INIT FOSSIL AFT EXTERNAL") : _
  2037.                SYSTEM
  2038.       CALL DelayTime (2)
  2039.       CALL RestoreCom
  2040.       END SUB
  2041. * REPLACING old line(s) by new
  2042. 63330 ' $SUBTITLE: 'ReadMacro - sub to read macro'
  2043. ' $PAGE
  2044. '
  2045. '  NAME    -- ReadMacro
  2046. '
  2047. '  INPUTS  -- PARAMETER             MEANING
  2048. '
  2049. '  OUTPUTS -- ZOutTxt$               LINE TO PROCESS IN MACRO
  2050. '             ZMacroActive           FLAG WHETHER IN A MACRO
  2051. '
  2052. '  PURPOSE -- Reads in a line from macro file (#6) and processes
  2053. '             macro commands, which are:
  2054. '             *0 - display what follows, no carriage return
  2055. '             *1 - display what follows with carriage return
  2056. '             *B - display block that follows
  2057. '             *F - display File
  2058. * ------[ first line different ]------
  2059. '             GF - display Graphics version of a file      'Pe050501
  2060. '             WT - wait specified # of seconds
  2061. '             >> - append following block to specified file
  2062. '             ST - stack following (with carriage return)
  2063. '             ON - define case
  2064. '             == - case value that applies to following block
  2065. '             M! - execute following macro
  2066. '             M@ - abort macro processing
  2067. '             EY - Echo on (yes)
  2068. '             EN - Echo off (no)
  2069. '             /* - comment line skipped in processing
  2070. '             TK - Turbo key on (if user preference)
  2071. '             << - Read from file into a form
  2072. '             := - Assign value to work variable
  2073. '             LO - Set the location of a file
  2074. '
  2075.       SUB ReadMacro STATIC
  2076.       IF ZMacroTemplate$ <> "" THEN _
  2077.          GOTO 63392
  2078.       IF ZDistantTGet = 2 THEN _
  2079.          GOTO 63349
  2080. * REPLACING old line(s) by new
  2081. 63336 GOSUB 63395
  2082.       IF NOT ZMacroActive THEN _
  2083.          ZMacroEcho = ZTrue : _
  2084.          EXIT SUB
  2085.       IF CompareVar > 0 THEN _
  2086.          IF NOT CaseExecute THEN _
  2087. * ------[ first line different ]------
  2088.             IF LEFT$(ZOutTxt$,3) = ZSmartTextCode$+STRING$(2,61) THEN _ ' DD021301
  2089.                WasX$ = RIGHT$(ZOutTxt$,LEN(ZOutTxt$)-3) : _
  2090.                GOTO 63370 _
  2091.             ELSE IF LEFT$(ZOutTxt$,7) = ZSmartTextCode$ + "END ON" THEN _
  2092.                     CompareVar = 0 : _
  2093.                     GOTO 63336 _
  2094.                   ELSE GOTO 63336
  2095.       IF LEN(ZOutTxt$) < 3 THEN _
  2096.          GOTO 63398
  2097.       WasX$ = RIGHT$(ZOutTxt$,LEN(ZOutTxt$)-3)
  2098.       IF LEFT$(ZOutTxt$,1) <> ZSmartTextCode$ THEN _
  2099.          GOTO 63398
  2100.       CALL CheckInt (MID$(ZOutTxt$,2))
  2101.       IF ZErrCode > 0 THEN _
  2102.          GOTO 63398
  2103.       IF ZTestedIntValue > 0 AND ZTestedIntValue <= ZMaxWorkVar THEN _
  2104.          ZOutTxt$ = WasX$ : _  ' Macro command ask
  2105.          ZForceKeyboard = ZTrue : _
  2106.          ZMacroSave = ZTestedIntValue : _
  2107.          ZLinesPrinted = 1 : _
  2108.          ZNonStop = (ZPageLength < 1) : _
  2109.          EXIT SUB
  2110.       ON (1+INSTR("*0*1*B*FGFWT>>STON==M!M@EYEN/*TK<<:=LVNVCVLO",MID$(ZOutTxt$,2,2)))\2 GOTO _     'Pe050501
  2111.          63345, _  ' Display with no Carriage Return
  2112.          63347, _  ' Display with Carriage Return
  2113.          63340, _  ' Display Block
  2114.          63348, _  ' Display File
  2115.          63361, _  ' Display Graphics File                           'Pe050501
  2116.          63343, _  ' Wait # of seconds
  2117.          63350, _  ' Append to file
  2118.          63355, _  ' Stack
  2119.          63360, _  ' Case
  2120.          63370, _  ' Case Comparison
  2121.          63375, _  ' Macro execute
  2122.          63380, _  ' Macro Abort
  2123.          63383, _  ' Macro Echo on
  2124.          63385, _  ' Macro Echo off
  2125.          63336, _  ' Macro Comment
  2126.          63387, _  ' Turbo Key allowed
  2127.          63390, _  ' Form read
  2128.          63362, _  ' Assign value to work var
  2129.          63363, _  ' LV list verify
  2130.          63364, _  ' NV number verify
  2131.          63364, _  ' CV character verify
  2132.          63367     ' LO assign file location
  2133.       GOTO 63398
  2134. * REPLACING old line(s) by new
  2135. 63350 ZWasEN$ = WasX$            ' Append to file
  2136.       WasX = INSTR(ZWasEN$," /FL")
  2137.       OverStrike = (WasX > 0)
  2138.       IF OverStrike THEN _
  2139.          ZWasEN$ = LEFT$(ZWasEN$,WasX-1) + RIGHT$(ZWasEN$,LEN(ZWasEN$)-WasX-3)
  2140.       CALL Trim (ZWasEN$)
  2141.       CALL LockAppend
  2142.       IF ZErrCode > 0 THEN _
  2143.          GOTO 63352
  2144.       GOSUB 63395
  2145.       WasX$ = ZSmartTextCode$ + "END"
  2146.       WHILE ZMacroActive AND LEFT$(ZOutTxt$,4) <> WasX$
  2147. * ------[ first line different ]------
  2148.          CALL PrintWorkA (2,ZOutTxt$)                                ' DD040601
  2149.          GOSUB 63395
  2150.       WEND
  2151. * REPLACING old line(s) by new
  2152. * ------[ first line different ]------
  2153. 63355 CALL GlobalSrchRepl (WasX$,"|",ZCarriageReturn$,ZTrue)         ' KG011201
  2154.       ZCommPortStack$ = ZCommPortStack$ + WasX$ + ZCarriageReturn$   ' STack
  2155.       GOTO 63336
  2156. * INSERTING new line(s)
  2157. 63361  CALL Trim (WasX$)                                             'Pe050501
  2158.        Call Graphic (WasX$)                                          'Pe050501
  2159.        Call BufFile (WasX$,WasX)                                     'Pe050501
  2160.        GOTO 63336                                                    'Pe050501
  2161. * REPLACING old line(s) by new
  2162. 63362 CALL Trim (WasX$)
  2163.       CALL CheckInt (WasX$)
  2164. * ------[ first line different ]------
  2165.       WasX = INSTR(WasX$,SPACE$(1))                                  ' DD021301
  2166.       IF WasX > 0 AND ZTestedIntValue > 0 AND ZTestedIntValue <= ZMaxWorkVar THEN _
  2167.          ZGSRAra$(ZTestedIntValue) = RIGHT$(WasX$,LEN(WasX$)-WasX)
  2168.       GOTO 63336
  2169. * REPLACING old line(s) by new
  2170. 63364 CALL Trim (WasX$)
  2171. * ------[ first line different ]------
  2172.       WasX = INSTR(WasX$,SPACE$(1))                                  ' DD021301
  2173.       IF WasX = 0 THEN _
  2174.          GOTO 63336
  2175.       ZVerifyLow$ = LEFT$(WasX$,WasX-1)
  2176.       ZVerifyHigh$ = RIGHT$(WasX$,LEN(WasX$)-WasX)
  2177.       CALL Trim (ZVerifyLow$)
  2178.       CALL Trim (ZVerifyHigh$)
  2179.       ZVerifyNumeric = (MID$(ZOutTxt$,2,1) = CHR$(78))          'N   ' DD021301
  2180. * REPLACING old line(s) by new
  2181. * ------[ first line different ]------
  2182. 63396 CALL SmartText (ZOutTxt$,ZFalse, OverStrike,ZFalse)            'Pe 02/06/93
  2183.       CALL MetaGSR (ZOutTxt$,OverStrike)
  2184.       RETURN
  2185. * REPLACING old line(s) by new
  2186. 63400 ' $SUBTITLE: 'LockAppend - prepares for file append'
  2187. ' $PAGE
  2188. '
  2189. '  NAME    -- LockAppend
  2190. '
  2191. '  INPUTS  -- ZWasEN$            Name of file to append to
  2192. '
  2193. '  OUTPUTS -- none
  2194. '
  2195. '  PURPOSE -- Locks and opens file to append to
  2196. '
  2197.       SUB LockAppend STATIC
  2198. * ------[ first line different ]------
  2199.       IF ZNetWorkType <> 0 THEN _                                    'Pe 04/04/92
  2200.       WasBX = &H4 : _                                                'Pe 03/16/92
  2201.       ZSubParm = 9 : _                                               'Pe 03/16/92
  2202.       CALL FileLock
  2203.       ZErrCode = 0
  2204.       CALL OpenWorkA (2,ZWasEN$)                                     ' DD040601
  2205.       END SUB
  2206. * REPLACING old line(s) by new
  2207. 63410 ' $SUBTITLE: 'UnLockAppend - cleans up after file append'
  2208. ' $PAGE
  2209. '
  2210. '  NAME    -- UnLockAppend
  2211. '
  2212. '  INPUTS  -- none
  2213. '
  2214. '  OUTPUTS -- none
  2215. '
  2216. '  PURPOSE -- Unlocks and close file appending to
  2217. '
  2218.       SUB UnLockAppend STATIC
  2219. * ------[ first line different ]------
  2220.       IF ZNetWorkType <> 0 THEN _                                    'Pe 04/04/92
  2221.       WasBX = &H4 : _                                                'Pe 03/16/92
  2222.       ZSubParm = 10 : _                                              'Pe 03/16/92
  2223.       CALL FileLock
  2224.       CLOSE 2
  2225.       END SUB
  2226. * REPLACING old line(s) by new
  2227. 63422 IF EOF(2) OR ZNo OR (ZErrCode > 0) OR (ZSubParm < 0) THEN _
  2228.          Template$ = "" : _
  2229.          EXIT SUB
  2230.       IF FixedLength THEN _
  2231.          CALL ReadDir (2,1) : _
  2232.          ZGSRAra$(1) = ZOutTxt$ _
  2233.       ELSE CALL ReadParms (ZGSRAra$(),DataVar,1)
  2234.       WasX$ = Template$
  2235. * ------[ first line different ]------
  2236.       CALL SmartText (WasX$,ZTrue,OverStrike,ZFalse)                 ' Pe 02/06/93
  2237.       CALL MetaGSR (WasX$,OverStrike)
  2238.       CALL BufAsUnit (WasX$)
  2239.       IF RecPause OR (ZPageLength > 0 AND (ZLinesPrinted >= ZPageLength-1)) THEN _
  2240.          CALL PauseExit : _
  2241.          EXIT SUB
  2242.       GOTO 63422
  2243.       END SUB
  2244. * REPLACING old line(s) by new
  2245. 63465 ' Forces a keyboard pause inside a macro
  2246.       SUB PauseExit STATIC
  2247.       ZSubParm = 4
  2248.       ZTurboKey = -ZTurboKeyUser
  2249. * ------[ first line different ]------
  2250.       ZOutTxt$ = ZMorePrompt$ + LEFT$(CHR$(62),-1*ZExpertUser) + MID$("? : ",2*ZTurboKey+1,2) ' DD021301
  2251.       ZForceKeyboard = ZTrue
  2252.       ZNoAdvance = ZTrue
  2253.       CALL TPut
  2254.       ZLinesPrinted = 0
  2255.       ZUserIn$ = ""
  2256.       END SUB
  2257. * REPLACING old line(s) by new
  2258. 63470 ' $SUBTITLE: 'SetPrompt - sub to set prompts based on user security'
  2259. ' $PAGE
  2260. '
  2261. '  NAME    -- SetPrompt
  2262. '
  2263. '  INPUTS  -- PARAMETER           MEANING
  2264. '             ZBegMain          POSITION START OF MAIN CMDS
  2265. '             ZBegFile          POSITION START OF FILE CMDS
  2266. '             ZBegUtil          POSITION START OF UTIL CMDS
  2267. '             ZBegLibrary       POSITION START OF Library CMDS
  2268. '
  2269. '  OUTPUTS -- PRESENT.OPTS$         DISPLAY WHAT USER CAN DO (1st)
  2270. '             CALLERS.OPTS$         DISPLAY WHAT USER CAN DO (2nd)
  2271. '             ZMainOpts$            MAIN OPTS USER CAN DO
  2272. '             ZFileOpts$            FILE OPTS USER CAN DO
  2273. '             ZUtilOpts$            UTIL OPTS USER CAN DO
  2274. '             ZLibOpts$         Library OPTS USER CAN DO
  2275. '
  2276. '  PURPOSE -- Sets command line display of what user can do by
  2277. '             section and display of what all user can do
  2278. '
  2279.       SUB SetPrompt STATIC
  2280.       First = ZBegMain
  2281.       Last = ZBegFile - 1
  2282.       CALL SetOpts (ZMainOpts$,ZInvalidMainOpts$,First,Last)
  2283.       First = ZBegFile
  2284.       Last = ZBegUtil - 1
  2285.       CALL SetOpts (ZFileOpts$,ZInvalidFileOpts$,First,Last)
  2286.       First = ZBegUtil
  2287.       Last = ZBegLibrary - 1
  2288.       CALL SetOpts (ZUtilOpts$,ZInvalidUtilOpts$,First,Last)
  2289. * ------[ first line different ]------
  2290.       IF ZTempMaxBank <= 0 THEN                                      ' DD032902
  2291.          IF INSTR(ZUtilOpts$,MID$(ZUtilCmds$,1,1)) AND _             ' DD032902
  2292.             NOT INSTR(ZInvalidUtilOpts$,MID$(ZUtilCmds$,1,1)) THEN   ' DD032902
  2293.                ZInvalidUtilOpts$ = ZInvalidUtilOpts$ + _             ' DD032902
  2294.                   MID$(ZUtilCmds$,1,1)                               ' DD032902
  2295.                CALL Remove (ZUtilOpts$,MID$(ZUtilCmds$,1,1))         ' DD032902
  2296.          END IF                                                      ' DD032902
  2297.       END IF                                                         ' DD032902
  2298.       First = ZBegLibrary
  2299.       Last = ZBegLibrary + 6
  2300.       CALL SetOpts (ZLibOpts$,ZInvalidLibraryOpts$,First,Last)
  2301.       First = 50
  2302.       Last = 57                                                      ' DD020602/SFILE
  2303.       CALL SetOpts (SysOpt$,ZInvalidSysOpts$,First,Last)
  2304.       First = 46
  2305.       Last = 49
  2306.       CALL SetOpts (GlobalOpts$,InvalidGlobalOpts$,First,Last)
  2307.       IF LEN(SysOpt$) > 0 THEN _
  2308.          ZSystemOpts$ = "Sysop: " + _
  2309.                         SysOpt$
  2310.       ZMainOpts$ = GlobalOpts$ + ZMainOpts$                          ' DD092402/GOODBYE
  2311. '                  MID$(ZAllOpts$,INSTR(ZOrigCommands$,CHR$(71)),1)  ' DD021301/GOODBYE
  2312.       ZFileOpts$ = GlobalOpts$ + _
  2313.                    ZFileOpts$
  2314.       ZUtilOpts$ = GlobalOpts$ + _
  2315.                    ZUtilOpts$
  2316.       ZLibOpts$ = GlobalOpts$ + _
  2317.                       ZLibOpts$
  2318.       CALL SortString (SysOpt$)
  2319.       CALL SortString (ZMainOpts$)
  2320.       ZMainOpts$ = ZMainOpts$ + _
  2321.                    SysOpt$
  2322.       CALL SortString (ZFileOpts$)
  2323.       CALL SortString (ZUtilOpts$)
  2324.       CALL SortString (ZLibOpts$)
  2325.       CALL AddCommas (ZMainOpts$)
  2326.       CALL AddCommas (ZFileOpts$)
  2327.       CALL AddCommas (ZUtilOpts$)
  2328.       CALL AddCommas (ZLibOpts$)
  2329.       ZDirPrompt$ = ZEmphasizeOff$ + "What directory(s) (" + _       ' DD082102
  2330.          MID$("U)pload,A)ll,P)ers,L)ist,E)xtended +/-, [Q]uit)",8 * (ZUserSecLevel => ZMinSecToView) + 9)
  2331.       ZQuitPromptExpert$ = "QUIT [C],S, or to F,M,U"                 ' DD070502
  2332.       ZQuitPromptNovice$ = "QUIT [C]onference, S)ession or to " + _  ' DD070502
  2333.                            "section F)ile, M)ain, U)til"             ' DD070502
  2334.       ZQuitList$ = "FMUS@C"
  2335.       IF ZUserSecLevel < ZOptSec(18) THEN _
  2336.          ZQuitPromptExpert$ = LEFT$(ZQuitPromptExpert$,25) : _       ' DD070502
  2337.          ZQuitPromptNovice$ = LEFT$(ZQuitPromptNovice$,61) : _
  2338.          MID$(ZQuitList$,5) = SPACE$(1)                              ' DD021301
  2339.       IF ZUserSecLevel < ZOptSec(15) THEN _
  2340.          ZQuitPromptExpert$ = LEFT$(ZQuitPromptExpert$,24) + _       ' DD072502
  2341.                                MID$(ZQuitPromptExpert$,27) : _       ' DD072502
  2342.          ZQuitPromptNovice$ = LEFT$(ZQuitPromptNovice$,56) + _
  2343.                                MID$(ZQuitPromptNovice$,63) : _
  2344.          MID$(ZQuitList$,3,1) = SPACE$(1)                            ' DD021301
  2345.       IF ZUserSecLevel < ZOptSec(6) THEN _
  2346.          ZQuitPromptExpert$ = LEFT$(ZQuitPromptExpert$,18) + _       ' DD070502
  2347.                                MID$(ZQuitPromptExpert$,21) : _       ' DD070502
  2348.          ZQuitPromptNovice$ = LEFT$(ZQuitPromptNovice$,41) + _
  2349.                                MID$(ZQuitPromptNovice$,49) : _
  2350.          MID$(ZQuitList$,1,1) = SPACE$(1)                            ' DD021301
  2351.       CALL SetSection
  2352.       END SUB
  2353. * REPLACING old line(s) by new
  2354. 63520 ' $SUBTITLE: 'BinSearch - binary search a file'
  2355. ' $PAGE
  2356. '
  2357. '  NAME    -- BinSearch
  2358. '                                  MEANING
  2359. '  INPUTS  -- PassedSearchFor$  Value you are looking for
  2360. '             StartPos          Starting position of sort key
  2361. '             NumChars          # of characters in sort key
  2362. '             LenRec            Length of record of data file searching
  2363. '             High              Record # of last record
  2364. '             ZFastTabs$        In a binary integer subfield (2 bytes)
  2365. '                                  holds 1st record when might find
  2366. '                                  a key beginning with a particular
  2367. '                                  character (0-9,A-Z).   Empty if
  2368. '                                  no Fast Tab exists for the file.
  2369. * ------[ first line different ]------
  2370. '             FileNum           FileNumber                           ' DD031702
  2371. '
  2372. '  OUTPUTS -- RecFoundAt        Record # value found at (0 if none)
  2373. '             RecFound$         Full data record when found
  2374. '
  2375. '  PURPOSE -- Binary searches work file #2 for a key value in a
  2376. '             data file that is sorted on a key field
  2377. '
  2378.       SUB BinSearch (FileNum, PassedSearchFor$,StartPos, NumChars, LenRec, High, RecFoundAt, RecFound$) STATIC ' DD031702
  2379.       SearchFor$ = LEFT$(PassedSearchFor$,NumChars)
  2380.       SearchFor$ = SearchFor$ + SPACE$(NumChars-LEN(SearchFor$))
  2381.       FIELD #FileNum, LenRec AS SearchRec$                           ' DD031702
  2382.       Low = 0
  2383.       IF LEN(ZFastTabs$) < 72 THEN _
  2384.          GOTO 63522
  2385.       WasX$ = LEFT$(SearchFor$,1)
  2386.       WasX = INSTR("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",WasX$)
  2387.       IF WasX > 0 THEN _
  2388.          Low = CVI(MID$(ZFastTabs$,1+2*(WasX-1),2)) - 1 : _
  2389.          IF WasX < 36 THEN _
  2390.             High = CVI(MID$(ZFastTabs$,1+2*WasX,2))
  2391. * REPLACING old line(s) by new
  2392. 63522 RecFoundAt = 0
  2393.       IF High < 1 THEN _
  2394.          EXIT SUB
  2395.       WasX$ = SPACE$ (NumChars)
  2396.       Done = ZFalse
  2397.       WHILE NOT Done
  2398.          WasI = INT(((High/2) + (Low/2)) + .5)
  2399. * ------[ first line different ]------
  2400.          GET FileNum, WasI                                           ' DD031702
  2401.          LSET WasX$ = MID$(SearchRec$, StartPos, NumChars)
  2402.          IF WasX$ = SearchFor$ THEN _
  2403.             RecFound$ = SearchRec$: _
  2404.             RecFoundAt = WasI : _
  2405.             Done = ZTrue _
  2406.          ELSE IF (High - Low) < 2 THEN _
  2407.                  Done = ZTrue _
  2408.               ELSE IF WasX$ < SearchFor$ THEN _
  2409.                       Low = WasI _
  2410.                    ELSE IF WasX$ > SearchFor$ THEN _
  2411.                            High = WasI
  2412.       WEND
  2413.       END SUB
  2414. * REPLACING old line(s) by new
  2415. 63540 ' Match Name to one in message file
  2416.       SUB ChkMsgName (MsgFromCaller,MsgToCaller) STATIC
  2417. * ------[ first line different ]------
  2418.       IF ZNewUserDGS THEN _                                          'DGS-NEW
  2419.          CALL MsgNameMatch ("NEWUSER",ZActiveUserName$,6,MsgFromCaller) : _'DGS-NEW
  2420.          CALL MsgNameMatch ("NEWUSER",ZActiveUserName$,37,MsgToCaller) : _'DGS-NEW
  2421.       EXIT SUB                                                       ' Mpl090202
  2422.       IF NOT ZRemoteSysop THEN _
  2423.          WasX$ = LEFT$("SYSOP",-5*ZSysop) : _
  2424.          CALL MsgNameMatch (ZOrigUserName$,ZActiveUserName$,6,MsgFromCaller) : _'Dgs-ALSMod
  2425.          CALL MsgNameMatch (ZOrigUserName$,ZActiveUserName$,37,MsgToCaller) : _'Dgs-ALSMod
  2426.          EXIT SUB
  2427.       CALL MsgNameMatch ("SYSOP",ZSysopFullName$,6,MsgFromCaller)
  2428.       IF NOT MsgFromCaller THEN _
  2429.          CALL MsgNameMatch (ZOrigUserName$,"",6,MsgFromCaller)
  2430.       CALL MsgNameMatch ("SYSOP",ZSysopFullName$,37,MsgToCaller)
  2431.       IF NOT MsgToCaller THEN _
  2432.          CALL MsgNameMatch (ZOrigUserName$,"",37,MsgToCaller)
  2433.       END SUB
  2434.       SUB MsgNameMatch (PrimeName$,AltName$,SearchPos,Found) STATIC
  2435.       WasX$ = LEFT$(PrimeName$+SPACE$(2),22-8*(SearchPos < 7))       ' DD021301
  2436.       GOSUB 63542
  2437.       IF Found OR AltName$ = "" THEN _
  2438.          EXIT SUB
  2439.       WasX$ = LEFT$(AltName$ + SPACE$(2),22-8*(SearchPos < 7))       ' DD021301
  2440.       GOSUB 63542
  2441.       EXIT SUB
  2442. * REPLACING old line(s) by new
  2443. 63542 WasY$ = MID$(ZMsgRec$,SearchPos,LEN(WasX$))
  2444. * ------[ first line different ]------
  2445.       CALL SmartText(WasY$,ZFalse, OverStrike,ZFalse)                'Pe 02/05/93
  2446.       CALL AllCaps(WasY$)                                            'SM091908
  2447.       WasY$ = LEFT$(WasY$,LEN(WasX$))                                'SM091908
  2448.       ZWasDF = INSTR(WasY$,CHR$(64))                            '@   ' DD021301
  2449.       IF ZWasDF > 0 THEN _
  2450.          MID$(WasY$,ZWasDF) = SPACE$(6)                              ' DD021301
  2451.       Found = (WasY$ = WasX$)
  2452.       RETURN
  2453.       END SUB
  2454. * REPLACING old line(s) by new
  2455. 63550 ' Check whether message record is a msg header record
  2456.       SUB ChkIfMsgHeader STATIC
  2457.       ZOK = ZFalse
  2458. * ------[ first line different ]------
  2459.       IF MID$(ZMsgRec$,70,1) = CHR$(45) AND MID$(ZMsgRec$,73,1) = CHR$(45) THEN _ ' DD021301
  2460.          WasY = ASC(MID$(ZMsgRec$,116,1)) : _
  2461.          IF WasY > 224 AND WasY < 227 THEN _
  2462.             ZOK = ZTrue
  2463.       END SUB
  2464. * REPLACING old line(s) by new
  2465. * ------[ first line different ]------
  2466. 63572 ZOutTxt$ = "Time Extension reduced to"+ STR$(TimeToAdd) + _    ' DD060101
  2467.                  " due to " + ZOutTxt$ + " Event" : _
  2468.       CALL RingCaller
  2469.       CALL SkipLine (1)                                              ' DD050704
  2470.       END SUB
  2471. * REPLACING old line(s) by new
  2472. 63580 ' Displays user record
  2473.       SUB DispUserRec (ToPrint) STATIC
  2474.          ZOK = ZFalse
  2475.          WasX$ = MID$(ZUserRecord$,ZStartHash,ZLenHash)
  2476. * ------[ first line different ]------
  2477.          IF ASC(WasX$) = 0 OR LEFT$(WasX$,3) = SPACE$(3) THEN _      ' DD021301
  2478.             EXIT SUB
  2479.          WasOF = CVI(ZSecLevel$)
  2480.          IF WasOF > ZUserSecLevel THEN _
  2481.             IF NOT ZGlobalSysop THEN _
  2482.                EXIT SUB
  2483.          IF NOT ToPrint THEN                                         ' DD062202
  2484.             CALL ANSISysop5                                          ' DD062202
  2485.             EXIT SUB                                                 ' DD062202
  2486.          END IF                                                      ' DD062202
  2487.          IF ToPrint AND NOT ZPrinter THEN _                          ' DD122902
  2488.             ZPrinterSave = ZPrinter : _                              ' DD122902
  2489.             ZPrinter = ZTrue : _                                     ' DD122902
  2490.             CALL Line25                                              ' DD122902
  2491.          ZOutTxt$ = ZCRLf$ + "Record......" + STR$(LOC(5)) + ZCRLf$    ' DD062202
  2492.          ZOutTxt$ = ZOutTxt$ + "Name........ " + ZUserName$ + ZCRLf$  ' DD062202
  2493.          ZOutTxt$ = ZOutTxt$ + "From........ " + ZCityState$ + ZCRLf$ ' DD062202
  2494.          ZOutTxt$ = ZOutTxt$ + "SL.........." + STR$(WasOF) + ZCRLf$ ' DD062202
  2495.          ZOutTxt$ = ZOutTxt$ + "Password.... " + ZPswd$ + ZCRLf$      ' DD062202
  2496.          IF WasOF < ZOrigMainSec THEN                                ' DD062202
  2497.             ZOutTxt$ = ZOutTxt$ + "<Locked out>" + ZCRLf$            ' DD062202
  2498.          ELSEIF WasOF >= ZSysopSecLevel THEN                         ' DD062202
  2499.             ZOutTxt$ = ZOutTxt$ + "(SysOp)" + ZCRLf$                 ' DD062202
  2500.          END IF                                                      ' DD062202
  2501.          ZOutTxt$ = ZOutTxt$ + "Last On..... " + ZLastDateTimeOn$ + ZCRLf$ ' DD062202
  2502.          ZOutTxt$ = ZOutTxt$ + "DownLoads..." + STR$(CVI(ZUserDnlds$)) + ZCRLf$ ' DD062202
  2503.          ZOutTxt$ = ZOutTxt$ + "Uploads....." + STR$(CVI(ZUserUplds$)) + ZCRLf$ ' DD062202
  2504.          ZOutTxt$ = ZOutTxt$ + "Times On...." + STR$(CVI(MID$(ZUserOption$,1,2))) + ZCRLf$ ' DD062202
  2505.          ZOutTxt$ = ZOutTxt$ + "Time Used..." + STR$(CVI(ZElapsedTime$)) + " Mins" + ZCRLf$ ' DD062202
  2506.          ZOutTxt$ = ZOutTxt$ + "Time Banked." + STR$(ASC(ZBankTime$)) + ZCRLf$ ' DD062202
  2507.          ZOutTxt$ = ZOutTxt$ + "Carriers...." + STR$(ASC(ZDropTimes$)) + ZCRLf$ ' DD062202
  2508.          IF NOT ZEnforceRatios THEN _
  2509.             GOTO 63581
  2510.          ZOutTxt$ = ZOutTxt$ + "DL Bytes...." + STR$(CVS(ZDlBytes$)) + ZCRLf$ ' DD062202
  2511.          ZOutTxt$ = ZOutTxt$ + "UL Bytes...." + STR$(CVS(ZULBytes$)) + ZCRLf$ ' DD062202
  2512.          ZOutTxt$ = ZOutTxt$ + "DL Today...." + STR$(CVS(ZTodayDl$)) + ZCRLf$ ' DD062202
  2513.          ZOutTxt$ = ZOutTxt$ + "Bytes Today." + STR$(CVS(ZTodayBytes$)) + ZCRLf$ ' DD062202
  2514.          GOSUB 63583
  2515. * REPLACING old line(s) by new
  2516. 63581   IF (ZStartIndiv = 0 OR ZLenIndiv = 0) AND _
  2517.            (ZStartHash = 0 OR ZLenHash = 0) AND _
  2518.            NOT ZRestrictByDate THEN _
  2519.               GOTO 63582
  2520.         IF (ZStartHash > 1 AND ZLenHash > 0) THEN _
  2521.            ZOutTxt$ = "Hash: " + MID$(ZUserRecord$,ZStartHash,ZLenHash) _
  2522.         ELSE ZOutTxt$ = ""
  2523.         IF (ZStartIndiv > 1 AND ZLenIndiv > 0) THEN _
  2524.            ZOutTxt$ = ZOutTxt$ + " Indiv: " + MID$(ZUserRecord$,ZStartIndiv,ZLenIndiv)
  2525.         IF ZRestrictByDate THEN _
  2526.             CALL SetRegDisplay : _
  2527. * ------[ first line different ]------
  2528.             ZOutTxt$ = ZOutTxt$ + "Registered.. " + _                ' DD062202
  2529.                        ZRegDisplayDate$
  2530.         GOSUB 63583
  2531. * REPLACING old line(s) by new
  2532. 63582   ZOK = ZTrue
  2533. * ------[ first line different ]------
  2534.         ZPrinter = ZPrinterSave                                      ' DD122902
  2535.         CALL Line25                                                  ' DD122902
  2536.         EXIT SUB
  2537. * REPLACING old line(s) by new
  2538. 63583   IF ToPrint THEN _
  2539.             CALL Printit (ZOutTxt$)
  2540. * ------[ first line different ]------
  2541. '       CALL QuickTPut1 (ZOutTxt$)                                   ' DD062202
  2542.         RETURN
  2543.         END SUB
  2544. * REPLACING old line(s) by new
  2545. 63585 '  *  CALCULATE REGISTRATION DATES
  2546.         ' checks proposed new registration date
  2547.         SUB ResetRegDate (WorkDate$) STATIC ' Formerly 11470
  2548.         IF LEN(WorkDate$) < 10 THEN _
  2549.            WorkDate$ = LEFT$(WorkDate$,6) + _
  2550.                         "19" + _
  2551.                         RIGHT$(WorkDate$,2)
  2552.         ZTodayRegYY = VAL(MID$(WorkDate$,7))
  2553.         ZTodayRegMM = VAL(LEFT$(WorkDate$,2))
  2554.         ZTodayRegDD = VAL(MID$(WorkDate$,4,2))
  2555.         ZOK = ZTodayRegYY > 1979 AND ZTodayRegMM > 0 AND _
  2556.               ZTodayRegMM < 13 AND ZTodayRegDD > 0 AND _
  2557.               ZTodayRegDD < 32
  2558.         IF ZOK THEN _
  2559.            CALL TwoByteDate (ZTodayRegYY,ZTodayRegMM,ZTodayRegDD,ZRegDate$)
  2560.         END SUB
  2561.         ' Sets display of registration date
  2562.         SUB SetRegDisplay STATIC  ' Formerly 11480
  2563.         WasX$ = MID$(ZUserOption$,11,2)
  2564.         IF CVI(WasX$) <> 0 THEN _
  2565.            ZRegDate$ = WasX$ : _
  2566.         ELSE CALL RegToCurrent
  2567.         CALL UnPackDate (ZRegDate$,ZUserRegYY,ZUserRegMM,ZUserRegDD,ZRegDisplayDate$)
  2568.         IF CVI(WasX$) = 0 THEN _
  2569. * ------[ first line different ]------
  2570.            ZRegDisplayDate$ = STRING$(2,48) + CHR$(45) + _           ' DD021301
  2571.                               STRING$(2,48) + CHR$(45) + _           ' DD021301
  2572.                               STRING$(2,48)                          ' DD021301
  2573.         END SUB
  2574.         ' Sets registration date to current date
  2575.         SUB RegToCurrent STATIC    ' Formerly 11482
  2576.         WorkDate$ = DATE$
  2577.         CALL ResetRegDate (WorkDate$)
  2578.         END SUB
  2579. * REPLACING old line(s) by new
  2580. 63592 IF Showcur THEN _
  2581. * ------[ first line different ]------
  2582.          CALL QuickTPut (ZFG9$ + "Change ",0) : _                    ' DD030104
  2583.          CALL QuickTPut (ZFGB$ + Txt$,0) : _                         ' DD030104
  2584.          CALL QuickTPut (ZFG9$ + " from ",0) : _                     ' DD030104
  2585.          CALL QuickTPut (ZFGB$ + LTRIM$(STR$(CurVal)),0) : _         ' DD030104
  2586.          CALL QuickTPut (ZFG9$ + " to",0) _                          ' DD030104
  2587.       ELSE CALL QuickTPut (ZFGB$ + Txt$,0)                           ' DD030104
  2588.       CALL QuickTPut (ZEmphasizeOff$ + " (",0)                       ' DD030104
  2589.       CALL QuickTPut (ZFGB$ + LTRIM$(STR$(MinVal)),0)                ' DD030104
  2590.       CALL QuickTPut (ZEmphasizeOff$ + " - ",0)                      ' DD030104
  2591.       CALL QuickTPut (ZFGB$ + LTRIM$(STR$(MaxVal)) + ZEmphasizeOff$,0) ' DD030104
  2592.       ZOutTxt$ = ", [Q]uit)"
  2593. * REPLACING old line(s) by new
  2594. 63594 CALL PopCmdStack
  2595.       Temp$ = ZUserIn$(ZAnsIndex)
  2596.       CALL AllCaps (Temp$)
  2597.       CALL Trim (Temp$)
  2598. * ------[ first line different ]------
  2599.       IF ZSubParm > -1 AND Temp$ <> CHR$(81) AND ZWasQ <> 0 THEN _   ' DD021301
  2600.          GOTO 63595
  2601.       ZWasQ = 0
  2602.       IF ShowCur THEN _
  2603.          CALL QuickTPut1 (ZFGB$ + Txt$ + ZFG9$ + _                   ' DD030104
  2604.                           " Unchanged" + ZEmphasizeOff$)             ' DD030104
  2605.       EXIT SUB
  2606. * REPLACING old line(s) by new
  2607. 63595 CALL CheckInt (Temp$)
  2608.       IF ZTestedIntValue < MinVal OR ZTestedIntValue > MaxVal THEN _
  2609.          ZLastIndex = 0 : _
  2610. * ------[ first line different ]------
  2611.          CALL QuickTPut1 (ZFG9$ + "Min " + ZFGB$ + _                 ' DD030104
  2612.                           LTRIM$(STR$(MinVal)) + _                   ' DD030104
  2613.                           ZFG9$ + ", Max " + ZFGB$ + _               ' DD030104
  2614.                           LTRIM$(STR$(MaxVal)) + _                   ' DD030104
  2615.                           ZEmphasizeOff$) : _                        ' DD030104
  2616.          GOTO 63592                                                  ' DD030104
  2617.       IF ShowCur THEN _                                              ' DD030104
  2618.          CALL QuickTPut1 (ZFGB$ + Txt$ + ZFG9$ + " Set to " + _      ' DD030104
  2619.                           ZFGB$ + LTRIM$(STR$(ZTestedIntValue)) + _  ' DD030104
  2620.                           ZEmphasizeOff$)                            ' DD030104
  2621.       END SUB
  2622. * REPLACING old line(s) by new
  2623. 63600 ' MarkItems - Converts a list of items ZUserIn$(), items ZAnsIndex
  2624.       '             thru ZLastIndex, into a marked list MarkedList$.
  2625.       '
  2626. * ------[ first line different ]------
  2627.       '           - Verifies that marked items are available         ' DD031701
  2628.       '
  2629.       ' Major Revisions by Dan 'Grouch' Drinnon                      ' DD031701
  2630.       SUB MarkItems (IsMarking,MarkedList$,MarkedDesc$) STATIC
  2631.       IF NOT IsMarking THEN _
  2632.          EXIT SUB
  2633.       IF ZFileSysParm < 1 THEN                                       ' DD031701
  2634.          FOR Temp = ZAnsIndex to ZLastIndex                          ' DD031701
  2635.             MarkedList$ = MarkedList$ + ZUserIn$(Temp) + ZCarriageReturn$ ' DD031701
  2636.          NEXT                                                        ' DD031701
  2637.          GOTO 63602                                                  ' DD031701
  2638.       END IF                                                         ' DD031701
  2639.       BeginDir = ZAnsIndex                                           ' DD031701
  2640.       EndDir = ZLastIndex                                            ' DD031701
  2641.       LineToRead = 1                                                 ' DD050101
  2642.       FOR Temp = BeginDir to EndDir                                  ' DD031701
  2643.          ZWorkAra$(Temp) = UCASE$(ZUserIn$(Temp))                    ' DD031701
  2644.       Next Temp                                                      ' DD031701
  2645.       FOR Temp = BeginDir to EndDir                                  ' DD031701
  2646.          Dot = INSTR(ZWorkAra$(Temp),CHR$(46))                       ' DD031701
  2647. * INSERTING new line(s)
  2648. 63601    IF ZPersonalDnld THEN                                       ' DD032002
  2649.             CALL FindFile (ZPersonalDrvPath$ + ZWorkAra$(Temp),ZOK)  ' DD032002
  2650.          ELSE                                                        ' DD032002
  2651.             FOR Count = 1 TO ZSubDirCount                            ' DD031701
  2652.                CALL FindFile (ZSubDir$(Count) + ZWorkAra$(Temp),ZOK) ' DD031701
  2653.                IF ZOK THEN                                           ' DD032002
  2654.                   EXIT FOR                                           ' DD032002
  2655.                END IF                                                ' DD032002
  2656.             NEXT Count                                               ' DD032002
  2657.          END IF                                                      ' DD032002
  2658.          IF ZOK THEN                                                 ' DD031701
  2659.             MarkedList$ = MarkedList$ + ZWorkAra$(Temp) + ZCarriageReturn$ ' DD031701
  2660.          END IF                                                      ' DD031701
  2661.  
  2662.          IF NOT ZOK AND ZFastFileSearch THEN                         ' DD031701
  2663.             CALL BreakFileName (ZFastFileList$,Drive$,Body$,Ext$,ZTrue) ' DD050101
  2664.             FIDXList$ = Drive$ + Body$ + ".LST"                      ' DD050101
  2665.             CALL FindFile (FIDXList$,UseList)                        ' DD050101
  2666.             IF UseList THEN                                          ' DD050101
  2667.                CALL OpenWork (11,FIDXList$)                          ' DD050101
  2668.                IF ZErrCode = 0 THEN                                  ' DD050101
  2669.                   DO                                                 ' DD050101
  2670.                      CALL ReadParmsX (11,ZOutTxt$(),4,LineToRead)    ' DD050101
  2671.                      IF ZErrCode <> 0 AND ZOutTxt$(1) = "" THEN      ' DD050101
  2672.                         EXIT DO                                      ' DD050101
  2673.                      END IF                                          ' DD050101
  2674.                      LineToRead = LineToRead + 1                     ' DD050101
  2675.                      TFastFileList$ = UCASE$(ZOutTxt$(1))            ' DD050101
  2676.                      GOSUB 63603                                     ' DD050101
  2677.                      IF ZOK THEN                                     ' DD050101
  2678.                         CLOSE 11                                     ' DD050101
  2679.                         EXIT DO                                      ' DD080101
  2680.                      END IF                                          ' DD050101
  2681.                      ZOutTxt$(1) = ""                                ' DD050101
  2682.                   LOOP WHILE NOT EOF(11)                             ' DD050101
  2683.                   CLOSE 11                                           ' DD050101
  2684.                END IF                                                ' DD050101
  2685.             ELSE                                                     ' DD050101
  2686.                TFastFileList$ = ZFastFileList$                       ' DD050101
  2687.                GOSUB 63603                                           ' DD050101
  2688.             END IF                                                   ' DD050101
  2689.          END IF                                                      ' DD031701
  2690.                                                                      ' DD050101
  2691.          IF NOT ZOK AND NOT Dot THEN                                 ' DD031701
  2692.             ZWorkAra$(Temp) = ZWorkAra$(Temp) + _                    ' DD031701
  2693.                               CHR$(46) + ZDefaultExtension$          ' DD031701
  2694.             Dot = ZTrue                                              ' DD031701
  2695.             LineToRead = 1                                           ' DD050101
  2696.             GOTO 63601                                               ' DD031701
  2697.          END IF                                                      ' DD031701
  2698.          IF NOT ZOK THEN                                             ' DD031701
  2699.             CALL WipeLine (79)                                       ' DD031701
  2700.             ZOutTxt$ = UCASE$(ZUserIn$(Temp)) + " not found!" + _    ' DD041701
  2701.                " Correct Name? " + ZPressEnterExpert$                ' DD031701
  2702.             ZSubParm = 1                                             ' DD031701
  2703.             CALL TGet                                                ' DD031701
  2704.             IF ZSubParm < 0 THEN                                     ' DD031701
  2705.                ZFileSysParm = 2                                      ' DD031701
  2706.                EXIT SUB                                              ' DD031701
  2707.             END IF                                                   ' DD031701
  2708.             IF ZWasQ <> 0 THEN                                       ' DD031701
  2709.                ZWorkAra$(Temp) = UCASE$(ZUserIn$(ZAnsIndex))         ' DD031701
  2710.                LineToRead = 1                                        ' DD050101
  2711.                GOTO 63601                                            ' DD031701
  2712.             END IF                                                   ' DD031701
  2713.             CALL WipeLine (79)                                       ' DD031701
  2714.          END IF                                                      ' DD031701
  2715.       NEXT Temp                                                      ' DD031701
  2716. 63602 CALL ReportMarked (MarkedList$,MarkedDesc$)                    ' DD031701
  2717.       EXIT SUB                                                       ' DD050101
  2718. 63603 FSize = 21                                                     ' DD050101
  2719.       CALL OpenRSeq (7,TFastFileList$,HighRec,WasX,21)               ' DD050101
  2720.       FIELD #7, 12 AS SearchFile$, _                                 ' DD050101
  2721.                  4 AS SearchPath$, _                                 ' DD050101
  2722.                  3 AS SearchDate$, _                                 ' DD050101
  2723.                  2 AS SearchCrLf$                                    ' DD050101
  2724.       GET 7,1                                                        ' DD050101
  2725.       IF SearchCrLf$ <> ZCRLf$ THEN                                  ' DD050101
  2726.          FSize = 18                                                  ' DD050101
  2727.          CALL OpenRSeq (7,TFastFileList$,HighRec,WasX,18)            ' DD050101
  2728.          FIELD #7, 12 AS SearchFile$, _                              ' DD050101
  2729.                     4 AS SearchPath$, _                              ' DD050101
  2730.                     2 AS SearchCrLf$                                 ' DD050101
  2731.       END IF                                                         ' DD050101
  2732.       IF ZErrCode <> 0 THEN                                          ' DD050101
  2733.          ZOK = ZFalse                                                ' DD050101
  2734.       END IF                                                         ' DD050101
  2735.       HoldFastTabs$ = ZFastTabs$                                     ' DD050101
  2736.       IF TFastFileList$ <> ZFastFileList$ THEN                       ' DD050101
  2737.          CALL BreakFileName (TFastFileList$,Pre$,Body$,Ext$,ZTrue)   ' DD050101
  2738.          FastTabFile$ = Pre$ + Body$ + "T" + Ext$                    ' DD050101
  2739.          CALL FindFile (FastTabFile$,UseTabs)                        ' DD050101
  2740.          IF UseTabs THEN                                             ' DD050101
  2741.             CALL OpenRSeq (12,FastTabFile$, WasX, WasY, 72)          ' DD050101
  2742.             FIELD 12, 72 AS TabRec$                                  ' DD050101
  2743.             GET 12, 1                                                ' DD050101
  2744.             ZFastTabs$ = TabRec$                                     ' DD050101
  2745.             CLOSE 12                                                 ' DD050101
  2746.          ELSE                                                        ' DD050101
  2747.             ZFastTabs$ = ""                                          ' DD050101
  2748.          END IF                                                      ' DD050101
  2749.       END IF                                                         ' DD050101
  2750.       CALL TrimTrail (ZWorkAra$(Temp),CHR$(46))                      ' DD050101
  2751.       CALL BinSearch (7,ZWorkAra$(Temp),1,12,FSize,HighRec,RecFoundAt,RecFound$) ' DD050101
  2752.       ZOK = (RecFoundAt > 0)                                         ' DD050101
  2753.       IF ZOK THEN                                                    ' DD050101
  2754.          MarkedList$ = MarkedList$ + ZWorkAra$(Temp) + ZCarriageReturn$ ' DD050101
  2755.       END IF                                                         ' DD050101
  2756.       ZFastTabs$ = HoldFastTabs$                                     ' DD050101
  2757.       RETURN                                                         ' DD050101
  2758.       END SUB
  2759.       SUB ReportMarked (MarkedList$,ListDesc$) STATIC
  2760.       CALL FindLast (MarkedList$,ZCarriageReturn$,Temp,ZLastIndex)
  2761.       CALL QuickTPut1 (STR$(ZLastIndex) + SPACE$(1) + ListDesc$ + "(s) now marked") ' DD021301
  2762.       CALL SmartPause                                                ' DD071002
  2763.       ZLastIndex = 0
  2764.       END SUB
  2765. * REPLACING old line(s) by new
  2766. 63605 ' AskItems - general routine for asking for a list of items.
  2767.       '            Calling program instructs what the valid commands
  2768.       '            are (ValidCmnd$), what the actual user command is
  2769.       '            (UserCmnd$), and whether to Mark the items.  Returns
  2770.       '            list of items in ZUserIn$().   Supports lists for viewing,
  2771.       '            downloading, and marking.   Gives option to operate
  2772.       '            on marked when items have been previously marked.
  2773.       '                Calling program tells what to mark (MarkedItems$)
  2774.       '            and how to describe the items gathering (ItemDesc$).
  2775.       '
  2776.       SUB AskItems (ValidCmnd$,UserCmnd$,DoMark,ItemDesc$,MarkedItems$) STATIC
  2777.       CALL AllCaps (UserCmnd$)
  2778.       Temp = INSTR(ValidCmnd$,UserCmnd$)
  2779.       IF Temp = 0 OR UserCmnd$ = "" THEN _
  2780.          EXIT SUB
  2781.       Temp = INSTR("VDM",UserCmnd$)
  2782. * ------[ first line different ]------
  2783.       ZOutTxt$ = ZEmphasizeOff$ + _                                  ' DD082101
  2784.                  MID$("ViewDnldMark",4*Temp-3,4) + _                 ' DD082101
  2785.                  " what " + ItemDesc$ + "(s)"                        ' DD082101
  2786.       IF Temp = 2 AND ZWildDownOK AND NOT ZPersonalDnld THEN _       ' DD031803/WILD
  2787.          ZOutTxt$ = ZOutTxt$ + " (WildCards OK)"                     ' DD030301/WILD
  2788.       IF Temp < 3 THEN IF MarkedItems$ <> "" THEN _
  2789.          ZoutTxt$ = ZOutTxt$ + ", M)arked"
  2790.       ZOutTxt$ = ZOutTxt$ + ZPressEnterExpert$                       ' DD091207
  2791.       ZStackC = ZTrue
  2792.       CALL PopCmdStack
  2793.       IF ZWasQ > 0 AND DoMark AND Temp = 3 THEN _
  2794.          CALL MarkItems (ZTrue,MarkedItems$,ItemDesc$)
  2795.       END SUB
  2796. * REPLACING old line(s) by new
  2797. 63610 ' UnMarkItems - takes an input (ZWasZ$), on input item number
  2798.       '               "OnItem", where number of last of the inputs
  2799.       '               is "LastItem", determines whether the option
  2800.       '               is one for marked items, and inserts any marked
  2801.       '               items in MarkedList$ into the input stream (ZUserIn$())
  2802.       '               at the item number (OnItem).  Reports
  2803.       '               whether found marked (FoundMarked),
  2804.       '               and if calling programs says to reinitialize
  2805.       '               the marked items (ReInit), empties the
  2806.       '               list of marked items (MarkedList$) when they
  2807.       '               are found.
  2808.       '
  2809.       SUB UnMarkItems (MarkedList$,OnItem, LastItem, FoundMarked,ReInit) STATIC
  2810.       FoundMarked = ZFalse
  2811.       CALL AllCaps (ZWasZ$)
  2812. * ------[ first line different ]------
  2813.       IF MarkedList$ <> "" THEN IF ZWasZ$ =CHR$(77) THEN _      'M   ' DD021301
  2814.          FoundMarked = ZTrue : _
  2815.          EndFile = LEN (MarkedList$) : _
  2816.          Temp = INSTR(MarkedList$,ZCarriageReturn$) : _
  2817.          ZUserIn$(OnItem) = MID$(MarkedList$,1,Temp-1) : _
  2818.          StartFile = Temp + 1 : _
  2819.          InsertAt = OnItem + 1 : _
  2820.          WHILE StartFile < EndFile : _
  2821.             Temp = INSTR(StartFile,MarkedList$,ZCarriageReturn$) : _
  2822.             FOR X = LastItem TO InsertAt STEP -1 : _
  2823.                ZUserIn$(X + 1) = ZUserIn$(X) : _
  2824.             NEXT : _
  2825.             LastItem = LastItem + 1 : _
  2826.             ZUserIn$(InsertAt) = MID$(MarkedList$,StartFile,Temp-StartFile) : _
  2827.             InsertAt = InsertAt + 1 : _
  2828.             StartFile = Temp + 1 : _
  2829.          WEND : _
  2830.          IF ReInit THEN _
  2831.             MarkedList$ = ""
  2832.       END SUB
  2833. * REPLACING old line(s) by new
  2834. 63615 ' * Sets up next message base link *
  2835.       SUB NextConf (DoJoin) STATIC
  2836.       IF ZLinkedConf$ = "" OR (NOT DoJoin) THEN _
  2837.          EXIT SUB
  2838. * ------[ first line different ]------
  2839. * INSERTING new line(s)
  2840. 63616 EndConf = INSTR(ZLinkedConf$,ZCarriageReturn$)                 ' KG013001
  2841.       LastConf = (EndConf = LEN(ZLinkedConf$))                       ' KG013001
  2842.       ZHomeConf$ = LEFT$(ZLinkedConf$,EndConf-1)
  2843.       IF ZNonStop THEN _
  2844.          CALL QuickTPut1 ("Joining linked conference " + ZHomeConf$) _
  2845.       ELSE _
  2846.          ZOutTxt$ = "Continue to linked conference " + ZHomeConf$ + " ([Y],S)kip,A)bort)" : _ ' KG020801
  2847.          CALL DeLink (ZHomeConf$) : _                                ' KG013001
  2848.          ZTurboKey = -ZTurboKeyUser : _
  2849.          ZSubParm = 1 : _
  2850.          CALL TGet : _
  2851.          IF ZWasQ > 0 AND NOT ZYes THEN _                            ' KG020801
  2852.             ZWasX$ = ZUserIn$(1) : _                                 ' KG013001
  2853.             CALL AllCaps (ZWasX$) : _                                ' KG013001
  2854.             ZLinkedConf$ = ZLinkedConf$ + ZHomeConf$ + ZCarriageReturn$ : _ ' KG013001
  2855.             IF LastConf OR ZWasX$ = CHR$(65) THEN _                  ' DD031501
  2856.                ZHomeConf$ = ""  : _                                  ' KG013001             ' KG013001
  2857.                ZGlobalRead = ZFalse : _                              ' KG013001
  2858.                EXIT SUB _                                            ' KG013001
  2859.             ELSE GOTO 63616                                          ' KG013001
  2860.       END SUB
  2861. * REPLACING old line(s) by new
  2862. 63625 ' * Sets SysOp security variables Formerly 5370 of rbbs-pc.bas
  2863.       ' * Returns ZWasA true when remote or global sysop
  2864.       SUB SetSysOp STATIC
  2865.       ZRemoteSysop = ((ZActiveUserName$ = ZSecretName$) OR _
  2866. * ------[ first line different ]------
  2867.                       (ZOrigUserName$ = ZSecretName$)) OR _          ' Mpl090202
  2868.                       (ZActivUserName$ ="SYSOP")                     'LK 12/05/91
  2869.       ZWasA = ZRemoteSysop
  2870.       ZGlobalSysop = (ZGlobalSysop OR (ZWasA AND ZOrigCnfg$ = ZConfigFileName$))
  2871.       IF ZGlobalSysop THEN _
  2872.          ZWasA = ZTrue
  2873.       END SUB
  2874. * REPLACING old line(s) by new
  2875. 63630 ' * Sets the user preferences based on user record.
  2876.       ' * Formerly in RBBS-PC.BAS
  2877.       SUB SetUserPref STATIC
  2878.       IF ZWasA THEN _
  2879.          ZUserSecLevel = ZSysopSecLevel _
  2880.       ELSE ZUserSecLevel = CVI(ZSecLevel$)
  2881. * ------[ first line different ]------
  2882.       ZDropTimes = ASC(ZDropTimes$)                                  ' DD091401/DROP
  2883.       ZBankTime = ASC(ZBankTime$)
  2884.       ZLastMsgRead = CVI(MID$(ZUserOption$,3,2))
  2885.       ZUserXferDefault$ = MID$(ZUserOption$,5,1)
  2886.       IF ZUserXferDefault$ = SPACE$(1) THEN _                        ' DD021301
  2887.          ZUserXferDefault$ = CHR$(78)                                ' DD021301
  2888.       CALL XferType (2,ZTrue)
  2889.       WasX = ASC(MID$(ZUserOption$,6,1))
  2890.       IF WasX < 30 OR WasX > 99 THEN                                 ' DD061301
  2891.          WasX = 60                                                   ' DD061301
  2892.       END IF                                                         ' DD052002
  2893.       ZWasGR = (WasX MOD 5)                                          ' DD061301
  2894.       ZBoldText$ = CHR$(48 - (WasX > 64))                            ' DD061301
  2895.       IF WasX > 64 THEN                                              ' DD061301
  2896.          ZUserTextColor = INT((WasX - ZWasGR)/5 + 18)                ' DD061301
  2897.       ELSE                                                           ' DD050201
  2898.          ZUserTextColor = INT((WasX - ZWasGR)/5 + 25)                ' DD061301
  2899.       END IF                                                         ' DD050201
  2900.       IF ZUserTextColor > 37 THEN _
  2901.          ZUserTextColor = 37                                         ' DD061301
  2902.       IF ZEmphasizeOff$ <> "" THEN _
  2903.          CALL QuickTPut (ZColorReset$,0)
  2904.       IF ZEmphasizeOnDef$ <> "" THEN _
  2905.          ZEmphasizeOff$ = ZEscape$ + CHR$(91) + ZBoldText$ + ";40;" + MID$(STR$(ZUserTextColor),2) + CHR$(109) _ ' DD021301
  2906.       ELSE ZEmphasizeOff$ = ""
  2907.       IF ZWasGR = 1 AND NOT ZEightBit THEN _
  2908.          ZWasGR = 0
  2909. '     CALL SetGraphic (ZWasGR)                                       ' DD062304
  2910.       ZRightMargin = ASC(MID$(ZUserOption$,7,1))                     ' DD063002
  2911.       IF ZRightMargin > 72 THEN _
  2912.          ZRightMargin = 72
  2913.       IF NOT ZConfMode THEN _
  2914.          ZWasCI$ = ZCityState$ : _
  2915.          CALL Trim (ZWasCI$)
  2916.       UserOptions = CVI(MID$(ZUserOption$,9,2))
  2917.       ZPromptBell = (UserOptions AND 1) > 0
  2918.       ZExpertUser = (UserOptions AND 2) > 0
  2919.       CALL SetExpert
  2920.       ZNulls = (UserOptions AND 4) > 0
  2921.       ZUpperCase = (UserOptions AND 8) > 0
  2922.       ZLineFeeds = (UserOptions AND 16) > 0
  2923.       ZCheckBulletLogon = (UserOptions AND 32) > 0
  2924.       ZSkipFilesLogon = (UserOptions AND 64) > 0
  2925.       ZFullScreenEditor = (UserOptions AND 128) > 0                  'Pe 09/02/91
  2926.       ZReqQuesAnswered = (UserOptions AND 256) > 0
  2927.       ZMailWaiting = (UserOptions AND 512) > 0
  2928.       WasX = (UserOptions AND 1024 ) > 0
  2929.       CALL SetHiLite (NOT WasX)
  2930.       IF NOT ZHiLiteOff THEN _
  2931.          CALL QuickTPut (ZEmphasizeOff$,0)
  2932.       ZTurboKeyUser = (UserOptions AND 2048) > 0
  2933.       CALL SetGraphic (ZWasGR)                                       ' DD062304
  2934.       ZTurboKey = ZFalse
  2935.       ZFileWaiting = (UserOptions AND 4096) > 0
  2936.       ZAvailableForChat = (UserOptions AND 8192) > 0                 ' JM092401/RCHAT
  2937.       ZExtendedOff = (UserOptions AND 16384) > 0                     ' DD062901
  2938.       ExtendedUserOptions = ASC(MID$(ZUserOption$,8,1))              ' DD063002
  2939.       ZReadNewMail = (ExtendedUserOptions AND 1) > 0                 ' DD070102
  2940.       ZReselectALL = (ExtendedUserOptions AND 2) > 0                 ' DD070103
  2941.       ZMorePromptLF = (ExtendedUserOptions AND 4) > 0                ' DD070104
  2942.       ZReselectGraphics = (ExtendedUserOptions AND 8) > 0            ' DD070105
  2943.       ZANSIMusic = (ExtendedUserOptions AND 16) > 0                  ' DD070402
  2944.       CALL SetANSIMusic                                              ' DD070402
  2945.       ZNeverCanPage = (ExtendedUserOptions AND 32) > 0               ' DD070601
  2946.       ZReselectProto = (ExtendedUserOptions AND 64) > 0              ' DD070905
  2947.       ZGlobalTwit = (ExtendedUserOptions AND 128) > 0                ' DD070506
  2948.       CALL SetRegDisplay                                             ' DD070402
  2949.       ZPageLength = ASC(MID$(ZUserOption$,13,1))
  2950.       IF ZSubBoard THEN _
  2951.          GOTO 63632
  2952.       WasX$ = ZEchoer$
  2953.       ZEchoer$ = MID$(ZUserOption$,14,1)
  2954.       IF INSTR("ICR",ZEchoer$) = 0 THEN _
  2955.          ZEchoer$ = CHR$(82)                                    'R   ' DD021301
  2956.       IF WasX$ <> ZEchoer$ THEN _
  2957.          CALL ReportEcho
  2958.       CALL SetEcho (ZEchoer$)
  2959. * REPLACING old line(s) by new
  2960. 63635 ' * Reports who is doing echoing.  Formerly 9525 of rbbs-pc.bas
  2961.       SUB ReportEcho STATIC
  2962. * ------[ first line different ]------
  2963.       IF ZEchoer$ = CHR$(82) THEN _                             'R   ' DD021301
  2964.          ZOutTxt$ =  "RBBS now set" _
  2965.       ELSE IF ZEchoer$ = CHR$(67) THEN _                        'C   ' DD021301
  2966.               ZOutTxt$ = "Please set your communications package" _
  2967.            ELSE ZOutTxt$ = "Intermediate host now set"
  2968.       CALL QuickTPut1 (ZOutTxt$ + " to echo what you type")
  2969.       END SUB
  2970. * REPLACING old line(s) by new
  2971. 63640 ' * Welcomes caller on
  2972.       SUB SayWelcome STATIC
  2973. * ------[ first line different ]------
  2974.       LOCATE ZLocalPageLength-1,1,1                                  ' DD021903/VGA
  2975.       CALL AMorPM
  2976.       ZUserLogonTime! = TIMER
  2977.       ZTimeLoggedOn$ = TIME$
  2978.       ZLinesPrinted = 0
  2979.       ZExpertUser = ZFalse
  2980.       CALL SetExpert
  2981.       ZOutTxt$ = ""
  2982.       IF ZMaxNodes > 1 THEN _
  2983.          ZOutTxt$ = " - Node " + ZNodeID$
  2984.       IF ZReliableMode THEN _
  2985.          ZOutTxt$ = ZOutTxt$ + " (Reliable)"
  2986. '     CALL QuickTPut1 ("Welcome to " + ZRBBSName$ + ZOutTxt$)        'Pe 06/26/92
  2987.       CALL TestANSI
  2988.       ZTestParity = ZTrue
  2989.       ZStopInterrupts = ZTrue
  2990.       ZFileName$ = ZPreLog$
  2991.       CALL FlushCom (WasX$)
  2992.       ZCommPortStack$ = ""
  2993.       END SUB
  2994. * REPLACING old line(s) by new
  2995. 63650 ' * Sets privileges based on PASSWRDS file
  2996.       ' * Formerly 5135-5160 in RBBS-PC.BAS
  2997.       SUB SetPrivileges STATIC
  2998.       ZWasZ$ = ""
  2999.       CALL SrchPasswrds (Found)
  3000.       IF NOT Found THEN _
  3001.          ZTempTimeAllowed = ZMinsPerSessionDef : _
  3002.          ZTempMaxPerDay = ZMaxPerDayDef : _
  3003.          ZTempExpiredSec = ZExpiredSec : _
  3004.          ZMaxBank = ZMaxBankTimeDef _
  3005.       ELSE ZTimeLockSet = ZTempTimeLock : _
  3006.            ZDaysInRegPeriod = ZTempRegPeriod : _
  3007.            ZMaxBank = ZTempMaxBank
  3008.       ZMinsPerSession = ZTempTimeAllowed
  3009.       ZMaxPerDay = -(ZMaxPerDay * (ZTempMaxPerDay <= 0)) - _
  3010.                      (ZTempMaxPerDay * (ZTempMaxPerDay > 0))
  3011. * ------[ first line different ]------
  3012.       IF ZLimitMinsPerSession THEN                                   ' DD032101
  3013.          IF ZMinsPerSession > ZLimitMinsPerSession THEN              ' DD032101
  3014.             ZMinsPerSession = ZLimitMinsPerSession                   ' DD032101
  3015.           IF (NOT ZExitToDoors) AND (NOT ZSubBoard) AND _            ' DD032101
  3016.              (NOT AlreadyShown) THEN                                 ' DD032101
  3017.                ZOutTxt$ = "An External Event is Coming Up in" + _    ' DD091702
  3018.                           STR$(ZMinsPerSession) + _                  ' DD091702
  3019.                           " Minutes."                                ' DD032101
  3020.                CALL SkipLine(1)                                      ' DD032101
  3021.                CALL QuickTput(ZFGF$ + ZBG1$ + ZOutTxt$ + _           ' DD092302
  3022.                               ZEmphasizeOff$,1)                      ' DD032101
  3023.                ZOutTxt$ = "Your Time Online Has Been Shortened."     ' DD032101
  3024.                CALL RingCaller                                       ' DD032101
  3025.                CALL SkipLine (1)                                     ' DD032101
  3026.                 AlreadyShown = ZTrue                                 ' DD032101
  3027.             END IF                                                   ' DD032101
  3028.          END IF                                                      ' DD032101
  3029.       END IF                                                         ' DD032101
  3030. * INSERTING new line(s)
  3031. 63651 CALL SetSessionTime                                            ' DD012401
  3032.       END SUB
  3033. * REPLACING old line(s) by new
  3034. 63675 SUB SetUserUpDn STATIC
  3035.       ZDnlds = CVI(ZUserDnlds$)
  3036.       ZUplds = CVI(ZUserUplds$)
  3037. * ------[ first line different ]------
  3038.       ZDropTimes = ASC(ZDropTimes$)                                  ' DD091401/DROP
  3039.       ZBankTime = ASC(ZBankTime$)
  3040.       IF ZEnforceRatios THEN _
  3041.          ZDLToday! = CVS(ZTodayDl$) : _
  3042.          ZBytesToday! = CVS(ZTodayBytes$) : _
  3043.          ZDLBytes! = CVS(ZDlBytes$) : _
  3044.          ZULBytes! = CVS(ZULBytes$)
  3045.       END SUB
  3046.       SUB SetGlobalUpDn STATIC
  3047.       IF NOT ZGlobalsSet THEN _
  3048.          ZGlobalsSet = ZTrue : _
  3049.          ZGlobalDnlds = ZDnlds : _
  3050.          ZGlobalUplds = ZUplds : _
  3051.          ZGlobalDLToday! = ZDLToday! : _
  3052.          ZGlobalBytesToday! = ZBytesToday! : _
  3053.          ZGlobalDLBytes! = ZDLBytes! : _
  3054.          ZGlobalULBytes! = ZULBytes! : _
  3055.          ZGlobalDropTimes = ZDropTimes : _                           ' DD091401/DROP
  3056.          ZGlobalBankTime = ZBankTime
  3057.       END SUB
  3058. * REPLACING old line(s) by new
  3059. 63700 ' $SUBTITLE: 'TestANSI - test caller for ANSI support'
  3060. ' $PAGE
  3061. '
  3062. '  NAME    -- TestANSI
  3063. '                                  MEANING
  3064. '  INPUTS  -- ZTestANSITime   # of seconds to wait for ANSI response
  3065. '                             0 = do not test for ANSI
  3066. '
  3067. * ------[ first line different ]------
  3068. '  OUTPUTS -- ZCanANSIChat      = ZTrue if ANSIChat possible         ' DD071301/CHAT
  3069. '
  3070. '  PURPOSE -- Test callers' software for support of ANSI graphics
  3071. '
  3072.       SUB TestANSI STATIC
  3073.       IF ZTestANSITime < 1 THEN _
  3074.          GOTO 63705
  3075.       IF ZLocalUser THEN _
  3076.          IF ZDOSAnsi THEN _
  3077.             GOTO 63710 _
  3078.          ELSE GOTO 63705
  3079.       CALL FlushCom(Temp$)
  3080.       CALL PutCom (ZEscape$ + "[6n")
  3081.       CALL WipeLine (5)                                              ' DA040301
  3082.       FOR Temp = 1 TO ZTestANSITime                                  ' DA040301
  3083.          CALL DelayTime(1)                                           ' DA040301
  3084.          CALL FlushCom(Temp$)                                        ' DA040301
  3085.          IF LEN(Temp$) > 0 THEN                                      ' DA040301
  3086.             GOTO 63702                                               ' DA040301
  3087.          END IF                                                      ' DD080903
  3088.       NEXT Temp                                                      ' DD080903
  3089. * INSERTING new line(s)
  3090. 63702 Temp = INSTR(Temp$,ZEscape$)                                   ' DA040301
  3091.       IF Temp > 0 THEN _                                             ' DA040301
  3092.          CALL FlushCom(Temp2$) : _                                   ' DA040301
  3093.          Temp$ = Temp$ + Temp2$ : _                                  ' DA040301
  3094.          Temp = INSTR(Temp,Temp$,CHR$(82)) : _                  'R   ' DD021301
  3095.          IF TEMP > 0 AND TEMP < 9 THEN _
  3096.             GOTO 63710
  3097. * REPLACING old line(s) by new
  3098. 63705 ZHiLiteOff = ZTrue
  3099. * ------[ first line different ]------
  3100.       CALL SetHiLite(ZHiLiteOff)                                     ' DD010208
  3101.       CALL SetGraphic (0)
  3102.       EXIT SUB
  3103. * REPLACING old line(s) by new
  3104. 63710 CALL SetGraphic(2)
  3105.       ZHiLiteOff = ZFalse
  3106. * ------[ first line different ]------
  3107.       CALL SetHiLite(ZHiLiteOff)                                     ' DD010208
  3108. '     CALL QuickTPut1 ("ANSI detected")                              ' DD071601
  3109.       IF ZDOSANSI THEN _                                             ' DD071301/ANSICHAT
  3110.          ZCanANSIChat = ZTrue                                        ' DD071301/ANSICHAT
  3111.       CALL FlushCom(Temp$)                                           ' DD061301
  3112.       CALL PutCom (ZEscape$ + "[!")                                  ' DD061301
  3113.       CALL WipeLine (5)                                              ' DD080903
  3114.       FOR Temp = 1 TO ZTestANSITime                                  ' DD080903
  3115.          CALL DelayTime (1)                                          ' DD080903
  3116.          CALL FlushCom (Temp$)                                       ' DD080903
  3117.          IF LEN(Temp$) > 0 THEN                                      ' DD080903
  3118.             Temp = INSTR(UCASE$(Temp$),"RIPSCRIP")                   ' DD061301
  3119.             IF Temp THEN                                             ' DD061301
  3120.                ZRIPGraphics = ZTrue                                  ' DD062302
  3121.                CALL SetGraphic(4)                                    ' DD061301
  3122.                EXIT FOR                                              ' DD080903
  3123.             END IF                                                   ' DD080903
  3124.          END IF                                                      ' DD061301
  3125.       NEXT Temp                                                      ' DD080903
  3126.       END SUB
  3127. * REPLACING old line(s) by new
  3128. 63720 SUB AraAllCaps (Ara$(1),WhichElement) STATIC
  3129.       Temp$ = Ara$(WhichElement)
  3130.       CALL AllCaps (Temp$)
  3131.       Ara$(WhichElement) = Temp$
  3132.       END SUB
  3133. * ------[ first line different ]------
  3134. '                                                                    ' Mpl090202
  3135. ' $SUBTITLE: 'AutoLogOff - Subroutine to  to log off after transfer' ' Mpl090202
  3136. ' $PAGE                                                              ' Mpl090202
  3137. '                                                                    ' Mpl090202
  3138.       SUB AutoLogOff STATIC                                          ' Mpl090202
  3139.       ZAutoEnd = 0                                                   ' Mpl090202
  3140.       ZAbort = ZFalse                                                'Pe 01/19/92
  3141.       IF ZGetExtDesc = ZTrue or ZOK = ZFalse or ZAutoLogOffReq = ZTrue THEN _' Mpl090202
  3142.          EXIT SUB                                                    ' Mpl090202
  3143.       ZSubParm = 1                                                   ' Mpl090202
  3144.       ZStackC = ZTrue    'Pe 12/21/91                                ' Mpl090202
  3145. * INSERTING new line(s)
  3146. 64980 IF NOT ZExpertUser THEN _                                      ' DD010301
  3147.          GOTO 64999                                                  ' DD062401
  3148. 64981 ZOutTxt$ = ZFGE$ + ZConfName$ + + ZFG2$ + CHR$(58) + _    ':   ' DD062401
  3149.                  ZEmphasizeOff$                                      ' DD010301
  3150.       ZSubParm = 4                                                   ' DD010301
  3151.       CALL TPut                                                      ' DD010301
  3152.       CALL DispTimeRemain (MinsRemaining)                            ' DD123001
  3153.       ZOutTxt$ = ZFGF$ + "AUTOLOGOFF " + ZFG2$ + _                   ' DD010301
  3154.                  "command" + ZEmphasizeOff$                          ' DD010301
  3155.       IF ZCmndsInPrompt THEN                                         ' DD062804
  3156.          IF ZExpertUser THEN                                         ' DD062804
  3157.             ZOutTxt$ = ZOutTxt$ + " (?,A,[C],G,H)"                   ' DD062804
  3158.          ELSE                                                        ' DD062804
  3159.             ZOutTxt$ = ZOutTxt$ + " (?,A)bort,[C]ontinue,G)oodbye,H)elp)" ' DD062804
  3160.          END IF                                                      ' DD062804
  3161.       END IF                                                         ' DD062804
  3162. 64990 ZTurboKey = -ZTurboKeyUser                                     ' Mpl090202
  3163.       ZSubParm = 1                                                   ' Mpl090202
  3164.       Call TGet                                                      ' Mpl090202
  3165.       CALL Carrier                                                   'Pe 03/06/92
  3166.       IF ZSubParm = -1 THEN _                                        'Pe 03/06/92
  3167.          ZFileSysParm = 7 : _                                        'Pe 03/06/92
  3168.          EXIT SUB                                                    'Pe 03/06/92
  3169.       WasMplx = INSTR("CAGH?",UCASE$(ZUserIn$))                      ' DD062401
  3170.       IF ZUserIn$ = "" THEN _                                        ' DD062401
  3171.          GOTO 64995                                                  ' DD062401
  3172.       ON WasMplx GOTO 64995,64991,64998,64999,64999                  ' NW062401
  3173.       GOTO 64981                                                     ' DD062401
  3174. 64991 ZAutoEnd = 2                                                   ' DD010301
  3175.       GOTO 65000                                                     ' DD062401
  3176. 64995 ZAutoEnd = 3                                                   ' Mpl090202
  3177.       GOTO 65000                                                     ' DD062401
  3178. 64998 ZAutoEnd = 1                                                   ' Mpl090202
  3179.       ZAutoLogoffReq = ZTrue                                         'Pe 12/20/92
  3180.       GOTO 65000                                                     ' DD062401
  3181. 64999 ZStopInterrupts = ZTrue                                        ' DD062401
  3182.       AutoOffFile$ = ZWelcomeFileDrvPath$ + "AUTOOFF.MNU"            ' DD062401
  3183.       CALL Graphic(AutoOffFile$)                                     ' DD062401
  3184.       CALL BufFile(AutoOffFile$,X)                                   ' DD062401
  3185.       ZStopInterrupts = ZFalse                                       ' DD062401
  3186.       GOTO 64981                                                     ' DD062401
  3187. 65000 CALL SkipLine (1)                                              ' DD062401
  3188.       END SUB                                                        ' Mpl090202
  3189.       SUB BatchUpload (ZDesc$,ZUCat$,WasFF) STATIC                   ' Mpl090202
  3190.       ON WasFF GOTO 69000, 69500                                     ' Mpl090202
  3191. 69000 CALL OpenWorkA (2,ZNodeWorkDrvPath$ + "BatchUp" +ZNodeID$ +".LST") ' DD040601
  3192.       Call PrintWorkA (2,ZFileName$)                                 ' DD040601
  3193.       CALL PrintWorkA (2,ZFileNameHold$)                             ' DD040601
  3194.       CALL PrintWorkA (2,ZDesc$)                                     ' DD040601
  3195.       CALL PrintWorkA (2,ZUcat$)                                     ' DD040601
  3196. '     CLOSE 2                      'OpenWorkA Closes #2              ' DD060701
  3197.       CALL OpenWorkA (2,ZBatchWorkFile$)                             ' DD040601
  3198.       CALL PrintWorkA (2,ZFileName$)                                 ' DD040601
  3199.       CLOSE 2                                                        ' Mpl090202
  3200.       IF ZAnsindex = ZLastIndex THEN                                 ' Mpl090202
  3201.          ZUpBatchTransfer = ZFalse                                   ' Mpl090202
  3202.          ZWasBatchTransfer = ZTrue                                   ' Mpl090202
  3203.       END IF                                                         ' Mpl090202
  3204.       EXIT SUB                                                       ' Mpl090202
  3205. '                                                                    ' Mpl090202
  3206. 69500 CALL KillWork (ZBatchWorkFile$)                                ' Mpl090202
  3207.       ZErrCode = 0                                                   ' Mpl090202
  3208.       Temp$ = ZNodeWorkDrvPath$ + "BatchUp" + ZNodeid$ + ".LST"      ' DD032501
  3209.       CALL OpenWork (8,Temp$)                                        ' Mpl090202
  3210.       WHILE NOT EOF(8)                                               ' Mpl090202
  3211.          LINE INPUT #8,ZFileName$                                    ' Mpl090202
  3212.          LINE INPUT #8,ZFileNameHold$                                ' Mpl090202
  3213.          LINE INPUT #8,ZDesc$                                        ' Mpl090202
  3214.          LINE INPUT #8,ZUCat$                                        ' Mpl090202
  3215.          CALL Findit (ZFileName$)                                    ' Mpl090202
  3216.          IF ZOK THEN _                                               ' Mpl090202
  3217.             CALL UpdtUpload (ZCategoryName$(),ZCategoryCode$(), ZLinesInMsg,2) _' Mpl090202
  3218.          ELSE CALL UpdtCalr (ZFileNameHold$ + " ABORTED during BatchUL",2)' Mpl090202
  3219.          ZWasBatchTransfer = ZFalse                                  'Pe 09/12/91
  3220.          ZAlreadyGiven = ZTrue                                       ' Mpl090202
  3221.       WEND                                                           ' Mpl090202
  3222.       CLOSE 8                                                        ' Mpl090202
  3223.       END SUB                                                        ' Mpl090202
  3224. '                                                                    ' Mpl090202
  3225. 69600 ' $SUBTITLE: 'BATCHIT - subroutine to list files for batch downloading'' Mpl090202
  3226. ' $PAGE                                                              ' Mpl090202
  3227. '                                                                    ' Mpl090202
  3228.       SUB BATCHIT STATIC                                             ' Mpl090202
  3229.       CALL QuickTPUT (ZFG2$ + "Enter filenames on " + _              ' DD090102
  3230.                       "Separate lines! " +  ZFGB$ + _                ' DD090102
  3231.                       "(EMPTY LINE ENDS)" + ZEmphasizeOff$,1)        ' DD090102
  3232.       ZWasB=1                                                        ' Mpl090202
  3233.       FOR BatchF = 2 TO 25                                           ' Mpl090202
  3234.          ZOutTxt$ = ZFGE$ + "Name of file #" + STR$(Batchf-1) + _    ' DD090102
  3235.               ZFG2$                                                  ' DD090102
  3236.          Call TGet                                                   ' Mpl090202
  3237.          IF ZUserIn$ = "" THEN GOTO 70415                            ' Mpl090202
  3238.          ZUserIn$(BatchF) = ZUserIn$                                 ' Mpl090202
  3239.          ZAnsIndex = BatchF+1                                        ' Mpl090202
  3240.       NEXT BatchF                                                    ' Mpl090202
  3241. 70415 BatchF =  BatchF-1                                             ' Mpl090202
  3242.       ZLastIndex = BatchF                                            ' Mpl090202
  3243.       END SUB                                                        ' Mpl090202
  3244. '                                                                    ' Mpl090202
  3245. ' $SUBTITLE: 'TStat --- Display Transfer Stats from Xfer-? file'     ' Mpl090202
  3246. ' $PAGE                                                              ' Mpl090202
  3247. '                                                                    ' Mpl090202
  3248.       SUB TStats STATIC                                              ' MplXfer
  3249.       ZDOZFile$ = ""                                                 ' DD070702
  3250.       CALL OpenWork (2,"XFER-" + ZNodeID$ + ".DEF")                  ' MplXfer
  3251.       IF ZErrCode <> 0 THEN _                                        ' Mpl090202
  3252.          EXIT SUB                                                    'Pe 06/01/92
  3253.       IF ZTransferFunction = 1 AND ZShowTimesDownloaded AND _        ' DD052301
  3254.          NOT ZPersonalDnld THEN                                      ' DD052301
  3255.          CALL OpenWorkA (7,ZNodeWorkDrvPath$ + "DOWNLIST.DAT")       ' DD052301
  3256.       END IF                                                         ' DD052301
  3257.       CALL QuickTPut1 (ZFGC$ + _                                     ' DD090502
  3258.           "File Transfer Statistics are as follows:" + SPACE$(7))    ' DD021301
  3259.       CALL QuickTPut1 (ZFGE$ + _                                     ' DD090502
  3260.           "FileName" + SPACE$(9) + "Bytes" + SPACE$(2) + _           ' DD021301
  3261.           "Dtr Rate" + SPACE$(2) + "CPS" + SPACE$(7) + "Errors" + _  ' DD021301
  3262.           SPACE$(2))                                                 ' DD021301
  3263.       CALL QuickTPut1 (ZFG2$ + STRING$(52,45) + ZEmphasizeOff$)      ' DD091207
  3264.       TempCount = 0                                                  ' DGS051505-DS
  3265.       WHILE NOT EOF(2)                                               ' MplXfer
  3266.          TempCount = TempCount + 1                                   ' DGS051505-DS
  3267.          LINE INPUT #2,Stat$                                         ' MplXfer
  3268.          WasS = INSTR(Stat$,"rs ")                                   ' DD070702
  3269.          IF WasS > 0 THEN _                                          ' MplXfer
  3270.             WasX$ = MID$(Stat$, 2, WasS)                             ' MplXfer
  3271.          Match = INSTR(Stat$, CHR$(46))                              ' DD021301
  3272.          IF Match > 0 THEN                                           ' DD052301
  3273.             WasZyX$ = MID$(Stat$, Match - 8, 12)                     ' DD052301
  3274.             IF INSTR(UCASE$(WasZyX$),".DOZ") THEN                    ' DD070702
  3275.                ZDOZFile$ = UCASE$(WasZyX$)                           ' DD070702
  3276.             END IF                                                   ' DD070702
  3277.             IF ZTransferFunction = 1 AND ZShowTimesDownloaded AND _  ' DD052301
  3278.                NOT ZPersonalDnld THEN                                ' DD052301
  3279.                CALL BreakFileName (WasZyX$,Drive$,Body$,Ext$,ZTrue)  ' DD052301
  3280.                IF NOT ZUpdateOnLine THEN                             ' DD052301
  3281.                   PRINT #7, Body$ + Ext$ + ",1"                      ' D052301
  3282.                ELSE                                                  ' D052301
  3283.                   PRINT #7, Body$ + Ext$                             ' DD052301
  3284.                END IF                                                ' D052301
  3285.             END IF                                                   ' DD052301
  3286.          END IF                                                      ' DD052301
  3287.          Match = 0                                                   ' MplXfer
  3288.          Start = 1                                                   ' MplXfer
  3289.          IF INSTR(WasZyX$,CHR$(92)) THEN                             ' DD070703
  3290.             Divider$ = CHR$(92)                                      ' DD070703
  3291.          ELSEIF INSTR(WasZyX$,CHR$(47)) THEN                         ' DD070703
  3292.             Divider$ = CHR$(47)                                      ' DD070703
  3293.          ELSE                                                        ' DD070703
  3294.             Divider$ = CHR$(92)                                      ' DD070703
  3295.          END IF                                                      ' DD070703
  3296.          DO                                                          ' MplXfer
  3297.             Match = INSTR(Start, WasZyX$, Divider$)                  ' DD070703
  3298.             IF Match > 0 THEN                                        ' DD070703
  3299.                WasZyX$ = RIGHT$(WasZyX$, LEN(WasZyX$) - Match)       ' DD070702
  3300.             END IF                                                   ' DD070703
  3301.          LOOP WHILE Match                                            ' MplXfer
  3302.          Match = 0                                                   ' MplXfer
  3303.          Start = 1                                                   ' MplXfer
  3304.          DO                                                          ' MplXfer
  3305.             Match = INSTR(Start, WasZyX$, SPACE$(1))                 ' DD021301
  3306.             IF Match > 0 THEN _                                      ' MplXfer
  3307.                WasZyX$ = RIGHT$(WasZyX$, LEN(WasZyX$) - Match)       ' MplXfer
  3308.          LOOP WHILE Match                                            ' MplXfer
  3309.          WasXy = LEN(WasZyX$)                                        ' MplXfer
  3310.          IF ZErrCode <> 0 THEN _                                     ' Mpl090202
  3311.            Exit Sub                                                  'Pe 06/01/92
  3312.          IF INSTR(UCASE$(WasZyX$),".DOZ") THEN                       ' DD070702
  3313.             ZDOZFile$ = UCASE$(WasZyX$)                              ' DD070702
  3314.             CALL Trim (ZDOZFile$)                                    ' DD070702
  3315.          END IF                                                      ' DD070702
  3316.          IF ZAdvanceProtoWrite THEN _                                ' DGS051505-DS
  3317.             IF TempCount = 1 THEN _                                  ' DGS051505-DS
  3318.                GOTO 70430                                            ' DGS051505-DS
  3319.          CALL QuickTPut1 (ZFGB$ + WasZyX$ + SPACE$(15-WasXy) + _     ' DD081801
  3320.               WasX$ + ZEmphasizeOff$)                                ' DD081801
  3321. 70430 WEND                                                           ' DGS051505-DS
  3322.       CLOSE 2                                                        ' MplXfer
  3323.       CLOSE 7                                                        ' DD052301
  3324. '                                                                    ' DD052301
  3325. ' * Update Downloads Field in FMS directory                          ' DD052301
  3326. '                                                                    ' DD052301
  3327.       IF ZTransferFunction = 1 AND ZShowTimesDownloaded AND _        ' DD052301
  3328.          ZUpdateOnLine AND NOT ZPersonalDnld THEN                    ' DD052301
  3329.          ZActiveFMSDir$ = ""                                         ' DD052301
  3330.          CALL OpenFMS (HighRec,CatLen)                               ' DD052301
  3331.          CLOSE 2                                                     ' DD052301
  3332.          ZActiveFMSDir$ = ZFMSDirectory$                             ' DD080904
  3333.          GOSUB 70450                                                 ' DD080904
  3334.          CALL OpenWork (18,ZNodeWorkDrvPath$ + "DOWNLIST.DAT")       ' DD080904
  3335.          WHILE NOT EOF(18)                                           ' DD080904
  3336.             CALL ReadDir (18,1)                                      ' DD080904
  3337.             FileToMatch$ = ZOutTxt$                                  ' DD080904
  3338.             Found = ZFalse                                           ' DD080904
  3339. 70440       FOR search = HighRec TO 1 STEP -1                        ' DD080904
  3340.                GET 9, search                                         ' DD052301
  3341.                IF LEFT$(SearchFileName$,LEN(FileToMatch$)) = FileToMatch$ THEN ' DD080904
  3342.                   DLTimes = VAL(SearchFileExtra$) + 1                ' DD052301
  3343.                   IF DLTimes > 10000 THEN                            ' DD062306
  3344.                      DLTimes = 9999                                  ' DD062306
  3345.                   END IF                                             ' DD052301
  3346.                   DLTimes$ = LTRIM$(STR$(DLTimes))                   ' DD052301
  3347.                   DLTimes$ = STRING$(5 - LEN(DLTimes$),CHR$(48)) + DLTimes$ ' DD052301
  3348.                   LSET SearchFileExtra$ = DLTimes$                   ' DD052301
  3349.                   IF ZNetWorkType <> 0 THEN                          ' DD052301
  3350.                      ZWasEN$ = ZActiveFMSDir$                        ' DD080904
  3351.                      ZSubParm = 9                                    ' DD052301
  3352.                      CALL FileLock                                   ' DD052301
  3353.                      ZErrCode = 0                                    ' DD052301
  3354.                   END IF                                             ' DD052301
  3355.                   PUT 9, search                                      ' DD052301
  3356.                   IF ZNetWorkType <> 0 THEN                          ' DD052301
  3357.                      ZSubParm = 10                                   ' DD052301
  3358.                      CALL FileLock                                   ' DD052301
  3359.                   END IF                                             ' DD052301
  3360.                   Found = ZTrue                                      ' DD080904
  3361.                   EXIT FOR                                           ' DD052301
  3362.                END IF                                                ' DD052301
  3363.             NEXT search                                              ' DD052301
  3364.             IF NOT Found AND ZChainedDir$ <> "" THEN                 ' DD080904
  3365.                ZActiveFMSDir$ = ZChainedDir$                         ' DD080904
  3366.                CALL OpenFMS (HighRec,CatLen)                         ' DD080904
  3367.                CLOSE 2                                               ' DD080904
  3368.                GOSUB 70450                                           ' DD080904
  3369.                GOTO 70440                                            ' DD080904
  3370.             END IF                                                   ' DD080904
  3371.          WEND                                                        ' DD052301
  3372.          CLOSE 18                                                    ' DD080904
  3373.          CLOSE 9                                                     ' DD052301
  3374.          CALL KillWork (ZNodeWorkDrvPath$ + "DOWNLIST.DAT")          ' DD052301
  3375.       END IF                                                         ' DD052301
  3376.       EXIT SUB                                                       ' DD080904
  3377. 70450 CALL OpenRSeq (9,ZActiveFMSDir$,HighRec,X,ZFMSFileLength)      ' DD080904
  3378.       FIELD #9, 13 AS SearchFileName$, _                             ' DD052301
  3379.                  9 AS SearchFileSize$, _                             ' DD052301
  3380.                 11 AS SearchFileDate$, _                             ' DD052301
  3381.                 ZMaxDescLen - 5 AS SearchFileDesc$, _                ' DD052301
  3382.                  5 AS SearchFileExtra$, _                            ' DD052301
  3383.                  3 AS SearchFileCat$, _                              ' DD052301
  3384.                  2 AS SearchCRLf$                                    ' DD052301
  3385.       RETURN                                                         ' DD080904
  3386.       END SUB                                                        ' MplXfer
  3387.