230 CR=1 ' Initialize "Carriage return" as default for output messages
240 UC=0 ' Set to 1 for all upper case letters
250 IF LOCAL THEN ON ERROR GOTO 0:NF$="SYSOP":LOGTIME$=TIME$:CLS:GOTO 830
260 FOR I=1 TO 2000:NEXT I
270 O$="WELCOME":GOSUB 2680
275 A$=STRING$(80,"*"):GOSUB 2120
280 '
290 ' *** SIGN ON AND VERIFY ***
300 '
310 N=2:GOSUB 3990:UC=1
320 A$="What Is Your First Name->":CR=0:GOSUB 2120:GOSUB 2300:NF$=A$
330 IF LEN(NF$)<3 THEN 320
340 IF NF$="SYSOP" THEN A$="That's an unusual and RESERVED name....Try another....":GOSUB 2120:GOTO 320
350 GOSUB 3990:A$="What is Your Last Name->":CR=0:GOSUB 2120:GOSUB 2300:NL$=A$
360 IF LEN(NL$)<3 THEN 350
370 GOSUB 3990:A$="What phone or location are you calling from->":CR=0:GOSUB 2120:GOSUB 2300:CNS$=A$
380 IF LEN(CNS$)<3 THEN 370
390 N=4:GOSUB 3990:A$="If you're not "+NF$+" "+NL$:GOSUB 2120
400 A$=" From "+CNS$:GOSUB 2120:GOSUB 3990
410 A$="Hit R to reenter else hit RETURN ->":CR=0:GOSUB 2120:GOSUB 2300:A$=LEFT$(A$,1):IF A$="R" THEN 320
420 LOCATE 25,1:PRINT STRING$(80," ")
430 '
440 ' *** RECORD LOGON ***
450 '
460 LOCATE 25,1:PRINT "LOGON at ";TIME$;" -- ";NF$;" ";NL$;" from ";CNS$;
470 UC=0:A$="Adding Your Name To Our List of Callers.... * ":CR=0:GOSUB 2120
480 CLOSE #2:OPEN "R",#2,"CALLS",6:FIELD #2,6 AS CA$:GET #2,1:LSET CA$=STR$(VAL(CA$)+1):CS$=CA$:PUT#2,1:CLOSE#2:GOTO 510
490 ' OPEN "I",2,"CALLS":LINE INPUT#2,CS$:CLOSE#2:GOTO 510
500 PRINT ERR,ERL:IF (ERR=53 AND ERL=520) THEN RESUME 580:ELSE RESUME 590
510 CLOSE #3:OPEN "NULOG" FOR OUTPUT AS #3:WRITE #3,CS$,NF$,NL$,CNS$,TIME$,DATE$
520 ON ERROR GOTO 500:OPEN "I",#2,"USERLOG"
530 IF EOF(2) GOTO 570
540 INPUT #2,XCS$,XNF$,XNL$,XCNS$,XT$,XD$
550 WRITE #3,XCS$,XNF$,XNL$,XCNS$,XT$,XD$
560 GOTO 530
570 CLOSE #2:KILL "USERLOG"
580 CLOSE #3:NAME "NULOG" AS "USERLOG":A$=" *":GOSUB 2120
590 LPRINT: LPRINT "LOGON -> # "CS$;" - ";NF$;" "NL$;" FROM ";CNS$;" AT ";TIME$;" ON ";DATE$
600 LOGTIME$=TIME$
610 SM=INP(233):IF SM>100 THEN BR$=" 300 BAUD" ELSE BR$="1200 BAUD"
620 LPRINT BR$:LOCATE 25,70:PRINT BR$
630 N=2:GOSUB 3990:A$="You Are Logged On As of => "+LEFT$(DATE$,2)+"/"+MID$(DATE$,4,2)+"/"+RIGHT$(DATE$,2)+" at "+TIME$+" -- Line Speed is "+BR$:GOSUB 2120:N=2:GOSUB 3990
640 A$=STRING$(80,"*"):GOSUB 2120
650 REM ********** BYPASS PASSWORD CHECK **********
660 GOTO 750
670 REM *******************************************
750 N=2:GOSUB 3990:A$="Do you wish to read the General Message Files ?(y/n)->":CR=0:GOSUB 2120:GOSUB 2300:GM$=LEFT$(A$,1):N=3:GOSUB 3990:IF GM$="N" OR GM$="n" THEN 765
1210 A$="Scan (S) ??, Post (P) ?? or Return (R) For A Different Board ->":CR=0:GOSUB 2120:GOSUB 2300
1230 IF A$="R" OR A$="r" OR A$="" THEN N=2:GOSUB 3990:GOTO 1030
1240 IF INSTR("SsPp",A$)=0 THEN GOSUB 2110: GOTO 1210
1250 IF INSTR("SsPp",A$)<3 THEN GOSUB 1330:N=2:GOSUB 3990:GOTO 1210
1260 GOSUB 1840:GOTO 1210
1270 RETURN
1280 REM ******************************************************
1290 REM ** **
1300 REM ** SCAN MESSAGES ROUTINE **
1310 REM ** **
1320 REM ******************************************************
1330 CLOSE #2:ON ERROR GOTO 1340:OPEN "I",2,BOARD$+"_NEXT":INPUT #2,M,NREC:CLOSE #2:GOTO 1350
1340 IF ERR=53 AND ERL=1330 THEN A$="There are no messages currently posted on this Bulletin Board ....":GOSUB 2120:RESUME 1510:ELSE PRINT ERR,ERL:RESUME 1510
1350 GOSUB 3990:A$="There are Message Numbers 1 -"+STR$(M-1):GOSUB 2120:GOSUB 3990
1360 A$="Start The Scan With Which Number? ('Q' to quit) ->":CR=0:GOSUB 2120:GOSUB 2300
1370 IF A$="Q" OR A$="q" THEN 1510
1380 IF VAL(A$)<1 OR VAL(A$)>M-1 OR VAL(A$)<>INT(VAL(A$)) THEN GOSUB 2110:GOTO 1350
1390 BS=VAL(A$)
1400 CLOSE #2:OPEN "R",2,BOARD$+"_TITLES",45
1410 FIELD #2,4 AS MSG$,4 AS REC$,35 AS TITLE$
1420 GOSUB 3990:C=1
1430 FOR X=BS TO M-1
1440 GET #2,X:MSG(X)=CVS(MSG$):REC(X)=CVS(REC$):TI$(X)=TITLE$
2090 IF ERR=53 AND ERL=1900 THEN:CLOSE #2:OPEN "O",#2,BOARD$+"_NEXT":PRINT #2,1,1:CLOSE #2:RESUME 1900:ELSE A$="Can not post message....Try another Board....":GOSUB 2120:RESUME 2080
2100 GOSUB 3990:A$=" .... Hit RETURN to continue ....":CR=0:GOSUB 2120:GOSUB 2300:C=1:GOSUB 3990:RETURN 'Suspend print after 20 lines / continue
2890 CLOSE 2:OPEN "I",2,"BBSDATA":D=0:WHILE NOT(EOF(2)):D=D+1:INPUT #2, ** **
2940 ' ** PAGE SYSTEM OPERATOR **
2950 ' ** **
2960 ' ******************************************
2970 IF LOCAL=1 THEN GOSUB 4330:GOTO 3040
2980 N=2:GOSUB 3990
2990 IF PAGE THEN A$="Page has been turned back off...":PAGE=0:GOSUB 2120:GOSUB 3990:GOTO 3040
3000 IF VAL(LEFT$(TIME$,2))>22 THEN A$="It's past the SYSOP's normal bedtime, but I'll try anyway...":GOSUB 2120:GOTO 3030
3010 IF VAL(LEFT$(TIME$,2))<7 THEN A$="The SYSOP's probably not out of bed yet, but I'll try anyway...":GOSUB 2120:GOTO 3030
3020 N=2:GOSUB 3990:A$="The Page has been turned on, if the SYSOP's around, he will answer it. Meanwhile, you can continue to use the system.":GOSUB 2120
3030 PAGE=1:GOSUB 3990
3040 RETURN
3050 ' ******************************************
3060 ' ** **
3070 ' ** ACCESS LIST OF CALLERS **
3080 ' ** **
3090 ' ******************************************
3100 A$="The 15 Most Recent Callers were....":GOSUB 2120
3290 CLOSE #2:OPEN "FEEDBACK" FOR APPEND AS #2:PRINT #2,FIRSTNAME$;",";LASTNAME$:PRINT#2,"":PRINT#2,STRING$(80,"-"):FOR QX=1 TO LINES:PRINT#2,L$(QX):NEXT QX:PRINT#2,"":PRINT#2,STRING$(80,"-"):CLOSE 2:A$="Written...":GOSUB 2120:GOSUB 3990
3300 RETURN
3310 ' ******************************************
3320 ' ** **
3330 ' ** CHAT MODE HANDLER **
3340 ' ** **
3350 ' ******************************************
3360 IF LOCAL=1 THEN GOSUB 4330:GOTO 3430
3370 PB$="":B$=""
3380 A$="Type a CTRL-E (CHR$(5)) then a CTRL-X (CHR$(24)) to end chat mode...":GOSUB 2120:N=2:GOSUB 3990
3390 A$=INKEY$:IF A$<>"" THEN B$=A$:PRINT B$;:PRINT #1,B$;
3400 IF LOC(1)>0 THEN B$=INPUT$(1,1):PRINT B$;:PRINT #1,B$;
3410 IF PB$=CHR$(5) AND B$=CHR$(24) THEN GOTO 3430
3420 PB$=B$:GOTO 3390
3430 RETURN
3440 ' ******************************************
3450 ' ** **
3460 ' ** DISPLAY DATE AND TIME **
3470 ' ** **
3480 ' ******************************************
3490 A$="Date & Time in Boston, Mass....":GOSUB 2120
21890 B$=STRING$(65," "):FOR I=1 TO N:A$="***"+B$+"***":GOSUB 2120:NEXT I:N=1:RETURN
21900 PRINT ERR,ERL:RESUME 21820
21910 IF ERR=53 AND ERL=21590 THEN A$="NO PROGRAMS IN HOLD AREA":GOSUB 2120:RESUME 21640:ELSE PRINT ERR,ERL:A$=">> OPTION NOT AVAILABLE AT PRESENT <<":GOSUB 2120:RESUME 21880
21920 REM ************010 '---------- GET Input from COMM ----------
22020 Y$=""
22030 FOR A=1 TO 420
22040 IF LOC(1)>0 THEN Y$=INPUT$(LOC(1),#1):RETURN
22050 NEXT A:Y$="":RETURN
22070 '---------- WAIT (Timeout) ----------
22090 FOR B=1 TO 10
22100 GOSUB 22020
22110 IF MID$(Y$,1,1)=SOH$ THEN RETURN
22120 IF MID$(Y$,1,1)=EOT$ THEN 22530
22130 IF MID$(Y$,1,1)=CAN$ THEN 22540
22140 IF Y$<>"" THEN GOSUB 22560:GOTO 22090
22150 NEXT B
22160 IF Y$="" THEN PRINT #1,NAK$;
22170 GOTO 22090
22180 '
22190 '---------- CHRISTIENSEN RECEIVE ----------
22200 '
22270 X$="":SEC=1
22280 PRINT #1,NAK$;
22290 GOSUB 22070 ' Timeout
22300 GOSUB 22020 ' Get Char
22310 IF Y$="" THEN PRINT "Timeout":GOTO 22340
22320 X$=X$+Y$
22330 IF LEN(X$)<=131 THEN 22300
22340 IF LEN(X$)= 132 THEN Z$=MID$(X$,4,128):N=132:GOTO 22420
22350 IF LEN(X$)= 131 THEN Z$=MID$(X$,3,128):N=131:GOTO 22420
22360 IF LEN(X$)> 132 THEN 22490
22370 IF X$=EOT$ THEN 22530
22380 IF X$=CAN$ THEN 22540
22390 GOTO 22480
22400 IF SEC<> VAL(MID$(X$,2,1) THEN 22510
22410 IF (SEC XOR 255) <> VAL(MID$(X$,3,1) THEN 22520
22420 FOR Q=1 TO 128:CK=CK+ASC(MID$(Z$,Q,1)):NEXT
22430 IF (CK AND 255) <> (ASC(MID$(X$,N,1))) THEN 22500
22440 PRINT "Received #";SEC:SEC=255 AND (SEC+1)
22450 PRINT #2,Z$;
22460 PRINT #1,ACK$;
22470 X$="":CK=0:GOTO 22300
22480 PRINT "Short Block in #" ;SEC:PRINT #1,NAK$;:GOTO 22470
22490 PRINT "Long Block in #" ;SEC:PRINT #1,NAK$;:GOTO 22470
22500 PRINT "Checksum Error in #";SEC:PRINT #1,NAK$;:GOTO 22470
22510 PRINT "Block # Error in #";SEC:PRINT #1,NAK$;:GOTO 22470
22520 PRINT "Complement Error in #";SEC:PRINT #1,NAK$;:GOTO 22470