home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib29b.dsk
/
PIN.EDITOR.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
18KB
|
394 lines
10 REM **********************
20 REM * PIN.EDITOR *
30 REM * BY WILLIAM EBURN *
40 REM * COPYRIGHT (C) 1986 *
50 REM * BY MICROSPARC, INC *
60 REM * CONCORD, MA 01742 *
70 REM **********************
80 HOME : VTAB 10: PRINT "** PIN.EDITOR by William Eburn **": PRINT : PRINT "** Copyright 1986 by MicroSPARC,Inc. **"
160 PRINT : PRINT : PRINT : HTAB 7: PRINT "Press Return to Continue";
170 GET Z$: PRINT
180 PS = 1: REM -- SET SELECTION CURSOR TO POSITION #1 --
190 HOME
200 REM --- ACCESS AUXILIARY RAM ---
210 POKE 49153,0: POKE 49238,0: POKE 49237,0
220 REM --- READ PORT SETTINGS AND STORE IN MAIN MEMORY ---
230 POKE 16400, PEEK(1144): REM -- DATA + STOP -- BAUD -- PORT #1 --
240 POKE 16401, PEEK(1145): REM -- PARITY -- PORT #1 --
250 POKE 16402, PEEK(1146): REM -- PORT #1 USE -- AUTO LF -- ECHO --
260 POKE 16403, PEEK(1147): REM -- COLUMN WIDTH -- PORT #1 --
270 POKE 16404, PEEK(1148): REM -- D+S #2 --
280 POKE 16405, PEEK(1149): REM -- P #2 --
290 POKE 16406, PEEK(1150): REM -- LF-ECHO #2 --
300 POKE 16407, PEEK(1151): REM -- CW #2 --
310 REM --- RETURN TO MAIN MEMORY ---
320 POKE 49236,0: POKE 49152,0
330 REM --- SET UP SCREEN FORMAT ---
340 HTAB 7: VTAB 1: INVERSE : PRINT "CURRENT ": REM -- 1 TRAILING SPACE --
350 HTAB 7: VTAB 2: PRINT "SETTINGS": NORMAL
360 HTAB 21: VTAB 1: PRINT "PORT #1 PORT #2": REM -- 2 SPACES --
370 HTAB 21: VTAB 2: PRINT "------- -------": REM -- 7 DASHES, 2 SPACES, 7 DASHES --
380 HTAB 4: VTAB 4: PRINT "Port Use -------": REM -- 7 DASHES --
390 HTAB 4: VTAB 6: PRINT "Column Width ---": REM -- 3 DASHES --
400 HTAB 4: VTAB 8: PRINT "Baud Rate ------": REM -- 6 DASHES --
410 HTAB 4: VTAB 10: PRINT "Parity ---------": REM -- 9 DASHES --
420 HTAB 4: VTAB 12: PRINT "Data+Stop Bits -"
430 HTAB 4: VTAB 14: PRINT "Auto Line Feed -"
440 HTAB 4: VTAB 16: PRINT "Echo to Screen -"
450 REM --- SET VARIABLES WITH PORT SETTINGS ---
460 A(1) = PEEK(16400): REM -- D+S -- B -- #1 --
470 X(1) = PEEK(16401): REM -- P #1 --
480 Y(1) = PEEK(16402): REM -- #1 USE -- ECHO -- LF --
490 D(1) = PEEK(16403): REM -- COL WIDTH #1 --
500 A(2) = PEEK(16404): REM -- D+S -- B -- #2 --
510 X(2) = PEEK(16405): REM -- P #2 --
520 Y(2) = PEEK(16406): REM -- #2 USE -- ECHO -- LF --
530 D(2) = PEEK(16407): REM -- COL WIDTH #2 --
540 REM --- SET PORT SELECTION FLAGS ---
550 FA = 0:FB = 0:FC = 0:FD = 0
560 REM --- CONVERT PORT CODES TO 'ENGLISH' & SET MASTER INPUT VALUES ---
570 IF A(1) -192 >0 THEN A(1) = A(1) -192:Q$ = "6+2":DS(3) = 192: GOTO 630
580 IF A(1) -160 >0 THEN A(1) = A(1) -160:Q$ = "7+2":DS(3) = 160: GOTO 630
590 IF A(1) -128 >0 THEN A(1) = A(1) -128:Q$ = "8+2":DS(3) = 128: GOTO 630
600 IF A(1) -64 >0 THEN A(1) = A(1) -64:Q$ = "6+1":DS(3) = 64: GOTO 630
610 IF A(1) -32 >0 THEN A(1) = A(1) -32:Q$ = "7+1":DS(3) = 32: GOTO 630
620 Q$ = "8+1":DS(3) = 0
630 IF A(1) = 31 THEN O$ = "19200":B(3) = 31
640 IF A(1) = 30 THEN O$ = "9600":B(3) = 30
650 IF A(1) = 28 THEN O$ = "4800":B(3) = 28
660 IF A(1) = 26 THEN O$ = "2400":B(3) = 26
670 IF A(1) = 24 THEN O$ = "1200":B(3) = 24
680 IF A(1) = 22 THEN O$ = " 300":B(3) = 22
690 IF A(1) = 19 THEN O$ = " 110":B(3) = 19
700 IF A(1) = <16 THEN O$ = "16X EXT.":B(3) = 0
710 IF FA = 1 THEN GOTO 800: REM --- IF FLAG SET JUMP TO PORT #2 DISPLAY
720 REM --- DISPLAY PORT #1 INFO TO SCREEN & SET INPUT VARIABLES ---
730 HTAB 23: VTAB 12: IF PS = 5 THEN INVERSE : REM -- HILITE IF CURSOR HERE --
740 PRINT Q$:DS(1) = DS(3): NORMAL
750 HTAB 22: VTAB 8: IF PS = 3 THEN INVERSE
760 PRINT O$:B(1) = B(3): NORMAL
770 REM --- SET FLAG & VARIABLE FOR PORT #2 & RERUN DISPLAY ---
780 FA = 1:A(1) = A(2): GOTO 570
790 REM --- DISPLAY PORT #2 INFO TO SCREEN & SET INPUT VARIABLES ---
800 HTAB 32: VTAB 12: IF PS = 15 THEN INVERSE
810 PRINT Q$:DS(2) = DS(3): NORMAL
820 HTAB 31: VTAB 8: IF PS = 13 THEN INVERSE
830 PRINT O$:B(2) = B(3): NORMAL
840 REM --- DO THE REST OF THE INFO THE SAME WAY ---
850 IF X(1) = 235 THEN P$ = "SPACE":P(3) = 235: GOTO 900
860 IF X(1) = 171 THEN P$ = "MARK":P(3) = 171: GOTO 900
870 IF X(1) = 107 THEN P$ = "EVEN":P(3) = 107: GOTO 900
880 IF X(1) = 43 THEN P$ = " ODD":P(3) = 43: GOTO 900
890 P$ = "NONE":P(3) = 11
900 IF FB = 1 THEN GOTO 940
910 HTAB 22: VTAB 10: IF PS = 4 THEN INVERSE
920 PRINT P$: NORMAL :P(1) = P(3)
930 FB = 1:X(1) = X(2): GOTO 850
940 HTAB 31: VTAB 10: IF PS = 14 THEN INVERSE
950 PRINT P$: NORMAL :P(2) = P(3)
960 REM --- IF COMM PORT, CR DISABLED ---
970 HTAB 21
980 IF D(1) = 0 THEN N$ = "DISABLE":PW(3) = 0: GOTO 1010
990 HTAB 23
1000 N$ = STR$(D(1)):PW(3) = D(1)
1010 IF FD = 1 THEN GOTO 1050
1020 VTAB 6: IF PS = 2 THEN INVERSE
1030 PRINT N$: NORMAL :PW(1) = PW(3)
1040 FD = 1:D(1) = D(2): GOTO 980
1050 VTAB 6: HTAB 30: IF PS = 12 THEN INVERSE
1060 IF N$ < >"DISABLE" THEN HTAB 32
1070 PRINT N$: NORMAL :PW(2) = PW(3)
1080 IF Y(1) -127 >0 THEN Y(1) = Y(1) -128:S$ = "YES":E(3) = 128: GOTO 1100
1090 S$ = "NO":E(3) = 0
1100 IF Y(1) -63 >0 THEN Y(1) = Y(1) -64:R$ = "YES":LF(3) = 64: GOTO 1120
1110 R$ = "NO":LF(3) = 0
1120 IF Y(1) = 1 THEN M$ = " COMM.":C(3) = 1: GOTO 1140
1130 M$ = "PRINTER":C(3) = 0
1140 IF FC = 1 THEN GOTO 1220
1150 VTAB 16: HTAB 23: IF PS = 7 THEN INVERSE
1160 PRINT S$: NORMAL :E(1) = E(3)
1170 VTAB 14: HTAB 23: IF PS = 6 THEN INVERSE
1180 PRINT R$: NORMAL :LF(1) = LF(3)
1190 VTAB 4: HTAB 21: IF PS = 1 THEN INVERSE
1200 PRINT M$: NORMAL :C(1) = C(3)
1210 FC = 1:Y(1) = Y(2): GOTO 1080
1220 VTAB 16: HTAB 32: IF PS = 17 THEN INVERSE
1230 PRINT S$: NORMAL :E(2) = E(3)
1240 VTAB 14: HTAB 32: IF PS = 16 THEN INVERSE
1250 PRINT R$: NORMAL :LF(2) = LF(3)
1260 VTAB 4: HTAB 30: IF PS = 11 THEN INVERSE
1270 PRINT M$: NORMAL :C(2) = C(3)
1280 VTAB 18: PRINT "________________________________________": REM -- 40 UNDERLINES --
1290 VTAB 20: HTAB 4: PRINT "To change settings, select with"
1300 VTAB 21: HTAB 4: PRINT "Arrows, then press Return key."
1310 INVERSE : VTAB 23: HTAB 2: PRINT "WHEN SETTINGS ARE OK, PRESS S TO SET";: NORMAL
1320 REM --- MOVE CURSOR TO SELECT PARAMETER ---
1330 POKE 49168,0: REM -- CLEAR KBD --
1340 GET MV$:MV = ASC(MV$)
1350 VTAB 20: HTAB 25: INVERSE : PRINT "-WAIT-": NORMAL
1360 IF MV = 10 OR MV = 11 OR MV = 8 OR MV = 21 OR MV = 13 OR MV = 83 OR MV = 115 THEN GOTO 1410
1370 PRINT CHR$(7): FLASH
1380 VTAB 1: HTAB 2: PRINT "INVALID ENTRY"
1390 VTAB 2: HTAB 2: PRINT "SELECT AGAIN": NORMAL : REM -- 2 SPACES --
1400 GOTO 1340
1410 VTAB 1: PRINT " ": REM -- 6 SPACES --
1420 PRINT " ": REM -- 6 SPACES --
1430 INVERSE : VTAB 1: HTAB 7: PRINT "CURRENT ": REM -- 1 TRAILING SPACE --
1440 VTAB 2: HTAB 7: PRINT "SETTINGS": NORMAL
1450 IF MV = 83 OR MV = 115 THEN GOTO 3590: REM -- ENDIT ON 'S' OR 's' --
1460 REM -- MOVE CURSOR TO SELECT SETTING --
1470 IF MV = 8 THEN PS = PS -10: REM -- LEFT ARROW --
1480 IF PS <1 THEN PS = PS +10: PRINT CHR$(7)
1490 IF MV = 21 THEN PS = PS +10: REM -- RIGHT ARROW --
1500 IF PS >17 THEN PS = PS -10: PRINT CHR$(7)
1510 IF MV = 11 THEN PS = PS -1: REM -- UP ARROW --
1520 IF MV = 11 AND PS <1 THEN PS = PS +1: PRINT CHR$(7)
1530 IF MV = 11 AND PS <11 AND PS >7 THEN PS = 11: PRINT CHR$(7)
1540 IF MV = 10 THEN PS = PS +1: REM -- DOWN ARROW --
1550 IF MV = 10 AND PS >17 THEN PS = 17: PRINT CHR$(7)
1560 IF MV = 10 AND PS >7 AND PS <11 THEN PS = 7: PRINT CHR$(7)
1570 IF MV = 13 THEN GOTO 1600: REM -- Return --
1580 GOTO 460: REM -- RE-WRITE SCREEN --
1590 REM -- SELECT PORTSET ROUTINE --
1600 ON PS GOSUB 2310,2430,1790,1950,1640,2200,2090,1780,1780,1780,3280,3400,2760,2920,2610,3170,3060
1610 GOSUB 3930: REM -- GO TO 'PINSETTER' SUBROUTINE --
1620 GOTO 190: REM -- DISPLAY NEW INFO --
1630 REM *** PORT VALUE SELECTION ROUTINES ***
1640 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #1 CONFIGURATION"
1650 VTAB 8: PRINT "DATA & STOP BITS": PRINT : PRINT : PRINT
1660 PRINT "(1) 6 DATA BITS / 1 STOP BITS"
1670 PRINT "(2) 6" SPC( 11)"/ 2"
1680 PRINT "(3) 7" SPC( 11)"/ 1"
1690 PRINT "(4) 7" SPC( 11)"/ 2"
1700 PRINT "(5) 8" SPC( 11)"/ 1"
1710 PRINT "(6) 8" SPC( 11)"/ 2" SPC( 10)"(DEFAULT)"
1720 PRINT : PRINT
1730 PRINT "ENTER SELECTION NUMBER (1-6)": GET SE$:SE = VAL(SE$)
1740 IF SE$ = CHR$(13) THEN SE = 6
1750 IF SE <1 OR SE >6 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 1730
1760 ON SE GOSUB 3660,3670,3680,3690,3700,3710: REM -- GET PORTSET VALUES --
1770 DS(1) = S
1780 RETURN
1790 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #1 CONFIGURATION"
1800 VTAB 8: PRINT "BAUD RATE": PRINT : PRINT
1810 PRINT "(1) 110"
1820 PRINT "(2) 300"
1830 PRINT "(3) 1200"
1840 PRINT "(4) 2400"
1850 PRINT "(5) 4800"
1860 PRINT "(6) 9600 (DEFAULT)"
1870 PRINT "(7) 19200"
1880 PRINT : PRINT
1890 PRINT "ENTER SELECTION NUMBER (1-7)": GET SE$:SE = VAL(SE$)
1900 IF SE$ = CHR$(13) THEN SE = 6
1910 IF SE <1 OR SE >7 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 1890
1920 ON SE GOSUB 3720,3730,3740,3750,3760,3770,3780
1930 B(1) = S
1940 RETURN
1950 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #1 CONFIGURATION"
1960 VTAB 8: PRINT "PARITY": PRINT : PRINT : PRINT
1970 PRINT "(1) NONE (DEFAULT)"
1980 PRINT "(2) EVEN"
1990 PRINT "(3) ODD"
2000 PRINT "(4) MARK"
2010 PRINT "(5) SPACE"
2020 PRINT : PRINT
2030 PRINT "ENTER SELECTION NUMBER (1-5)": GET SE$:SE = VAL(SE$)
2040 IF SE$ = CHR$(13) THEN SE = 1
2050 IF SE <1 OR SE >5 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 2030
2060 ON SE GOSUB 3790,3800,3810,3820,3830
2070 P(1) = S
2080 RETURN
2090 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #1 CONFIGURATION"
2100 VTAB 8: PRINT "ECHO TO SCREEN": PRINT : PRINT : PRINT
2110 PRINT "(1) YES"
2120 PRINT "(2) NO (DEFAULT)"
2130 PRINT : PRINT
2140 PRINT "ENTER SELECTION NUMBER (1-2)": GET SE$:SE = VAL(SE$)
2150 IF SE$ = CHR$(13) THEN SE = 2
2160 IF SE <1 OR SE >2 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 2140
2170 ON SE GOSUB 3840,3850
2180 E(1) = S
2190 RETURN
2200 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #1 CONFIGURATION"
2210 VTAB 8: PRINT "LINE FEED AFTER CARRIAGE RETURN": PRINT : PRINT : PRINT
2220 PRINT "(1) YES (DEFAULT)"
2230 PRINT "(2) NO"
2240 PRINT : PRINT
2250 PRINT "ENTER SELECTION NUMBER (1-2)": GET SE$:SE = VAL(SE$)
2260 IF SE$ = CHR$(13) THEN SE = 1
2270 IF SE <1 OR SE >2 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 2250
2280 ON SE GOSUB 3860,3870
2290 LF(1) = S
2300 RETURN
2310 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #1 CONFIGURATION"
2320 VTAB 8: PRINT "PORT USE": PRINT : PRINT : PRINT
2330 PRINT "(1) PRINTER (DEFAULT)"
2340 PRINT "(2) COMMUNICATIONS"
2350 PRINT : PRINT
2360 PRINT "ENTER SELECTION NUMBER (1-2) ": GET SE$:SE = VAL(SE$)
2370 IF SE$ = CHR$(13) THEN SE = 1
2380 IF SE <1 OR SE >2 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 2360
2390 ON SE GOSUB 3880,3890
2400 C(1) = S
2410 IF C(1) = 1 THEN PW(1) = 0
2420 RETURN
2430 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #1 CONFIGURATION"
2440 VTAB 8: PRINT "PRINTER LINE WIDTH": PRINT : PRINT : PRINT
2450 PRINT : PRINT "ENTER PRINTER LINE WIDTH (DEFAULT=80)"
2460 PRINT : PRINT " ('0' DISABLES FUNCTION)"
2470 PRINT
2480 INPUT PW$:PW(1) = VAL(PW$)
2490 IF PW$ = "" THEN PW(1) = 80: GOTO 2520
2500 IF VAL(PW$) = 0 AND PW$ < >"0" THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 2480
2510 IF PW(1) <0 OR PW(1) >255 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 2480
2520 IF C(1) = 1 AND PW(1) < >0 THEN PRINT CHR$(7); CHR$(7); CHR$(7); CHR$(7): GOTO 2540
2530 GOTO 2600
2540 HTAB 2: PRINT "DO YOU WISH TO OVERRIDE THE AUTOMATIC"
2550 HTAB 2: PRINT "DISABLE FEATURE ? (Y/N)"
2560 GET A$:A = ASC(A$)
2570 IF A < >89 AND A < >78 THEN PRINT "INCORRECT ANSWER, TRY AGAIN "; CHR$(7): GOTO 2560
2580 IF A = 89 THEN GOTO 2600
2590 PW(1) = 0
2600 RETURN
2610 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #2 CONFIGURATION"
2620 VTAB 8: PRINT "DATA & STOP BITS": PRINT : PRINT : PRINT
2630 PRINT "(1) 6 DATA BITS / 1 STOP BITS"
2640 PRINT "(2) 6" SPC( 11)"/ 2"
2650 PRINT "(3) 7" SPC( 11)"/ 1"
2660 PRINT "(4) 7" SPC( 11)"/ 2"
2670 PRINT "(5) 8" SPC( 11)"/ 1" SPC( 10)"(DEFAULT)"
2680 PRINT "(6) 8" SPC( 11)"/ 2"
2690 PRINT : PRINT
2700 PRINT "ENTER SELECTION NUMBER (1-6)": GET SE$:SE = VAL(SE$)
2710 IF SE$ = CHR$(13) THEN SE = 5
2720 IF SE <1 OR SE >6 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 2700
2730 ON SE GOSUB 3660,3670,3680,3690,3700,3710
2740 DS(2) = S
2750 RETURN
2760 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #2 CONFIGURATION"
2770 VTAB 8: PRINT "BAUD RATE": PRINT : PRINT : PRINT "(1) 16X EXTERNAL CLOCK"
2780 PRINT "(2) 110 BAUD"
2790 PRINT "(3) 300 (DEFAULT)"
2800 PRINT "(4) 1200"
2810 PRINT "(5) 2400"
2820 PRINT "(6) 4800"
2830 PRINT "(7) 9600"
2840 PRINT "(8) 19200"
2850 PRINT : PRINT
2860 PRINT "ENTER SELECTION NUMBER (1-8)": GET SE$:SE = VAL(SE$)
2870 IF SE$ = CHR$(13) THEN SE = 3
2880 IF SE <1 OR SE >8 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 2860
2890 ON SE GOSUB 3715,3720,3730,3740,3750,3760,3770,3780
2900 B(2) = S
2910 RETURN
2920 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #2 CONFIGURATION"
2930 VTAB 8: PRINT "PARITY": PRINT : PRINT : PRINT
2940 PRINT "(1) NONE (DEFAULT)"
2950 PRINT "(2) EVEN"
2960 PRINT "(3) ODD"
2970 PRINT "(4) MARK"
2980 PRINT "(5) SPACE"
2990 PRINT : PRINT
3000 PRINT "ENTER SELECTION NUMBER (1-5)": GET SE$:SE = VAL(SE$)
3010 IF SE$ = CHR$(13) THEN SE = 1
3020 IF SE <1 OR SE >5 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 3000
3030 ON SE GOSUB 3790,3800,3810,3820,3830
3040 P(2) = S
3050 RETURN
3060 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #2 CONFIGURATION"
3070 VTAB 8: PRINT "ECHO TO SCREEN": PRINT : PRINT : PRINT
3080 PRINT "(1) YES"
3090 PRINT "(2) NO (DEFAULT)"
3100 PRINT : PRINT
3110 PRINT "ENTER SELECTION NUMBER (1-2)": GET SE$:SE = VAL(SE$)
3120 IF SE$ = CHR$(13) THEN SE = 2
3130 IF SE <1 OR SE >2 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 3110
3140 ON SE GOSUB 3840,3850
3150 E(2) = S
3160 RETURN
3170 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #2 CONFIGURATION"
3180 VTAB 8: PRINT "LINE FEED AFTER CARRIAGE RETURN": PRINT : PRINT : PRINT
3190 PRINT "(1) YES"
3200 PRINT "(2) NO (DEFAULT)"
3210 PRINT : PRINT
3220 PRINT "ENTER SELECTION NUMBER (1-2)": GET SE$:SE = VAL(SE$)
3230 IF SE$ = CHR$(13) THEN SE = 2
3240 IF SE <1 OR SE >2 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 3220
3250 ON SE GOSUB 3860,3870
3260 LF(2) = S
3270 RETURN
3280 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #2 CONFIGURATION"
3290 VTAB 8: PRINT "PORT USE": PRINT : PRINT : PRINT
3300 PRINT "(1) PRINTER"
3310 PRINT "(2) COMMUNICATIONS (DEFAULT)"
3320 PRINT : PRINT
3330 PRINT "ENTER SELECTION NUMBER (1-2)": GET SE$:SE = VAL(SE$)
3340 IF SE$ = CHR$(13) THEN SE = 2
3350 IF SE <1 OR SE >2 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 3330
3360 ON SE GOSUB 3880,3890
3370 C(2) = S
3380 IF C(2) = 1 THEN PW(2) = 0
3390 RETURN
3400 HOME : PRINT : VTAB 3: HTAB 10: PRINT "PORT #2 CONFIGURATION"
3410 VTAB 8: PRINT "PRINTER LINE WIDTH": PRINT : PRINT : PRINT
3420 PRINT : PRINT " ENTER PRINTER LINE WIDTH"
3430 PRINT : PRINT "('0' DISABLES FUNCTION = DEFAULT)"
3440 PRINT
3450 INPUT PW$:PW(2) = VAL(PW$)
3460 IF PW$ = "" THEN PW(2) = 0: GOTO 3570
3470 IF VAL(PW$) = 0 AND PW$ < >"0" THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 3450
3480 IF PW(2) <0 OR PW(2) >255 THEN PRINT CHR$(7); CHR$(7);"INCORRECT VALUE, TRY AGAIN": GOTO 3450
3490 IF C(2) = 1 AND PW(2) < >0 THEN PRINT CHR$(7); CHR$(7); CHR$(7); CHR$(7): GOTO 3510
3500 GOTO 3570
3510 HTAB 2: PRINT "DO YOU WISH TO OVERRIDE THE AUTOMATIC"
3520 HTAB 2: PRINT "DISABLE FEATURE ? (Y/N)"
3530 GET A$:A = ASC(A$)
3540 IF A < >89 AND A < >78 THEN PRINT "INCORRECT ANSWER, TRY AGAIN "; CHR$(7): GOTO 2560
3550 IF A = 89 THEN GOTO 3570
3560 PW(2) = 0
3570 RETURN
3580 REM --- GO TO 'PINSETTER' SUBROUTINE ---
3590 GOSUB 3920
3600 HOME
3610 PRINT
3620 VTAB 14
3630 PRINT "-- SERIAL PORTS ARE NOW CONFIGURED --": VTAB 23
3640 END
3650 REM -- PORT SETTING VALUES --
3660 S = 64: RETURN
3670 S = 192: RETURN
3680 S = 32: RETURN
3690 S = 160: RETURN
3700 S = 0: RETURN
3710 S = 128: RETURN
3715 S = 0: RETURN
3720 S = 19: RETURN
3730 S = 22: RETURN
3740 S = 24: RETURN
3750 S = 26: RETURN
3760 S = 28: RETURN
3770 S = 30: RETURN
3780 S = 31: RETURN
3790 S = 11: RETURN
3800 S = 107: RETURN
3810 S = 43: RETURN
3820 S = 171: RETURN
3830 S = 235: RETURN
3840 S = 128: RETURN
3850 S = 0: RETURN
3860 S = 64: RETURN
3870 S = 0: RETURN
3880 S = 0: RETURN
3890 S = 1: RETURN
3900 REM ***** 'PINSETTER' SUBROUTINE *****
3910 REM
3920 REM *** ACCESS AUXILIARY TEXT PAGE #1 ***
3930 POKE 49153,0: POKE 49238,0: POKE 49237,0
3940 REM *** CONFIGURE PORT #1 ***
3950 POKE 1144,DS(1) +B(1): POKE 1145,P(1): POKE 1146,E(1) +LF(1) +C(1): POKE 1147,PW(1)
3960 REM *** CONFIGURE PORT #2 ***
3970 POKE 1148,DS(2) +B(2): POKE 1149,P(2): POKE 1150,E(2) +LF(2) +C(2): POKE 1151,PW(2)
3980 REM *** RETURN TO MAIN MEMORY ***
3990 POKE 49236,0: POKE 49152,0
4000 RETURN