1000 '"CHECKOUT" Test output ports, peripherals and handshake
1010 REV$="830115"'By Robert Hamilton
1020 MODEM$="COM1:300,N,8,1,CS300,DS300,CD0":NUMBER$="7678900":NUM=1
1030 SERIAL$=",N,8,1,RS":BAUD$="300":COL$="40":C$="":D$=""
1040 SCREEN 0,0,0:WIDTH 80:COLOR 2,0,0:KEY OFF:CLS:UP$=STRING$(1,30)
1050 LOCATE ,,1,12,13:DEF SEG=0:IF PEEK (&H410)= 109 THEN LOCATE ,,,6,7
1060 DEF SEG=64:POKE 23,128:DEF SEG:CL$=STRING$(79,0):Q$=CHR$(34)
1070 A$="ABCDEFGHI.JKLMNOPQR.STUVWXYZ0.123456789."
1080 B$="abcdefghi.jklmnopqr.stuvwxyz!.@#$%^&*()."
1090      REM: ?? KEYS
1100 FOR I=1 TO 10:ON KEY(I) GOSUB 0:KEY(I) ON:NEXT
1110 KEY 1,CHR$(27)+"CLS:LIST  "
1120 KEY 2,CHR$(27)+"RUN "+CHR$(7):KEY 3,CHR$(27)+"LOAD"+CHR$(7)+CHR$(34)
1130 KEY 4,CHR$(27)+"SAVE"+CHR$(34):KEY 5,CHR$(27)+"RUN"+CHR$(7)+CHR$(34):KEY 6,CHR$(27)+" GOTO 1000"
1140 KEY 7,CHR$(27)+CHR$(12)+"FILES "+CHR$(34)+"A:*.*":KEY 8,CHR$(27)+"RENUM 1000"
1150 KEY 9,CHR$(12)+"COLOR 6,0:CLS"+CHR$(13):KEY 10,CHR$(27)+"RUN"+CHR$(34)+"AUTOST"+CHR$(7)
1160      REM: ?? TITLE
1170 CLS:LOCATE 3,25:PRINT CHR$(213)+STRING$(31,205)+CHR$(184)
1180 PRINT TAB(25);CHR$(179)+STRING$(31,32)+CHR$(179)
1190 PRINT TAB(25);CHR$(179)+"        C H E C K O U T        ";CHR$(179)
1200 PRINT TAB(25);CHR$(179)+STRING$(31,32)+CHR$(179)
1210 PRINT TAB(25);CHR$(179)+"        Version: ";REV$;"        ";CHR$(179)
1220 PRINT TAB(25);CHR$(179)+STRING$(31,32)+CHR$(179)
1230 PRINT TAB(25);CHR$(212)+STRING$(31,205)+CHR$(190)
1240 PRINT CHR$(10);TAB(32);"By Hamilton Company"
1250 LOCATE 20,1:COLOR 6,0:PRINT"NOTE: Requires DOS Rev 1.10 & Basica";
1260      REM: ?? START program
1270 LOCATE 24,1:COLOR 0,7:PRINT" SPACE ";:COLOR 5,0:PRINT" To Test Ports  ";
1280 COLOR 0,7:PRINT" Q ";:COLOR 5,0:PRINT" Quit Program";
1290 K$=INKEY$:IF MID$(K$,1,1)="Q" OR MID$(K$,1,1)="q" THEN 1620
1300 IF K$="" THEN 1290
1310      REM: ?? MENU
1320 CLS:LOCATE 3,30:COLOR 2,0:PRINT"T E S T   M E N U"
1330 LOCATE 5,22:COLOR 6,0:PRINT"Key  Description":LOCATE 6,22:PRINT "===  ";STRING$(40,61)
1340 LOCATE 8,22:PRINT" 1   Parallel Port  LPT1:"
1350 LOCATE ,22:PRINT" 2   Parallel Port  LPT2:"
1360 LOCATE ,22:PRINT" 3   Parallel Port  LPT3:"
1370 LOCATE ,22:PRINT" A   Serial Port    COM1:"
1380 LOCATE ,22:PRINT" B   Serial Port    COM2:"
1390 LOCATE ,22:PRINT" C   CRT Display    SCRN:";CHR$(10)
1400 LOCATE ,22:PRINT" D   Dial Smart Modem        (COM1:Time Check)"
1410 LOCATE ,22:PRINT" I   Impulse Dial Modem      (COM1:Time Check)"
1420 LOCATE ,22:PRINT" M   Change Printed Message  (Times: ";MID$(STR$(NUM),2);")"
1430 LOCATE ,22:PRINT" R   Change Baud Rate       ";" (";BAUD$;")"
1440 LOCATE ,22:PRINT" S   Change Serial Handshake ";"(";SERIAL$;")"
1450 LOCATE ,22:PRINT" W   Change Message Width";"    (Col: ";COL$;")";CHR$(10)
1460 LOCATE ,22:PRINT" Q   Quit Program"
1470 LOCATE 24,1:COLOR 0,7:PRINT" KEY ";:COLOR 5,0:PRINT" Select Test";
1480 K$=INKEY$:IF MID$(K$,1,1)="1" THEN P$="LPT1:":GOTO 2100
1490 IF MID$(K$,1,1)="2" THEN P$="LPT2:":GOTO 2100
1500 IF MID$(K$,1,1)="3" THEN P$="LPT3:":GOTO 2100
1510 IF MID$(K$,1,1)="A" OR MID$(K$,1,1)="a" THEN S$="COM1:":GOTO 2150
1520 IF MID$(K$,1,1)="B" OR MID$(K$,1,1)="b" THEN S$="COM2:":GOTO 2150
1530 IF MID$(K$,1,1)="C" OR MID$(K$,1,1)="c" THEN 2210
1540 IF MID$(K$,1,1)="D" OR MID$(K$,1,1)="d" THEN X$="T":GOTO 2310
1550 IF MID$(K$,1,1)="I" OR MID$(K$,1,1)="i" THEN X$="P":GOTO 2310
1560 IF MID$(K$,1,1)="M" OR MID$(K$,1,1)="m" THEN 1630
1570 IF MID$(K$,1,1)="R" OR MID$(K$,1,1)="r" THEN 1820
1580 IF MID$(K$,1,1)="S" OR MID$(K$,1,1)="s" THEN 1700
1590 IF MID$(K$,1,1)="W" OR MID$(K$,1,1)="w" THEN 2490
1600 IF MID$(K$,1,1)="Q" OR MID$(K$,1,1)="q" THEN 1620
1610 GOTO 1480
1620 CLS:LOCATE 23,1:COLOR 6,0:PRINT"DONE";CHR$(10):KEY ON:SOUND 500,5:END
1630      REM: ?? MESSAGE
1640 CLS:LOCATE 22,1:COLOR 6,0:PRINT"REPEAT OUTPUT MESSAGE: (1 to 999 Times)";
1650 LOCATE 24,1:COLOR 0,7:PRINT" ENTER ";:COLOR 5,0:PRINT" 1 Time  ";
1660 COLOR 0,7:PRINT" NUMBER ";:COLOR 5,0:PRINT" Number of Times ";
1670 INPUT"",NUM2:IF NUM2=0 THEN NUM=1 ELSE NUM=NUM2
1680 IF NUM<1 OR NUM>999 THEN BEEP:GOTO 1640
1690 GOTO 1320
1700      REM: ?? HANDSHAKE
1710 CLS:LOCATE 10,1:COLOR 2,0:PRINT"SERIAL HANDSHAKE OPTIONS:"
1720 LOCATE 12,1:COLOR 6,0:PRINT"EXAMPLE: ,N,8,1,CS1000,DS1000";CHR$(10)
1730 PRINT"This is for No parity, 8 data bits, 1 stop bit, Clear to Send with"
1740 PRINT"a 1 second timeout, Data Set ready with 1 second timeout"
1750 LOCATE 18,1:PRINT"Refer to OPEN COM Statement in Basic Manual Rev 1.10 for more detail"
1760 LOCATE 22,1:PRINT "CURRENT HANDSHAKE OPTIONS: ";SERIAL$:LOCATE 24,1
1770 COLOR 0,7:PRINT " ENTER ";:COLOR 5,0:PRINT" No Change  ";:
1780 COLOR 0,7:PRINT " OPTIONS ";:COLOR 5,0:PRINT" Enter New Options  ";
1790 COLOR 6,0:LINE INPUT;"",SRL$:IF SRL$<>"" THEN SERIAL$=SRL$
1800 GOTO 1320
1810      REM: ?? BAUD
1820 CLS:LOCATE 10,28:COLOR 6,0:PRINT"Key  B A U D   M E N U":LOCATE 11,28:PRINT"===  ";STRING$(20,61)
1830 COLOR 6,0:LOCATE 13,28:PRINT" 1   BAUD RATE = 75"
1840 LOCATE ,28:PRINT" 2   BAUD RATE = 110"
1850 LOCATE ,28:PRINT" 3   BAUD RATE = 150"
1860 LOCATE ,28:PRINT" 4   BAUD RATE = 300"
1870 LOCATE ,28:PRINT" 5   BAUD RATE = 600"
1880 LOCATE ,28:PRINT" 6   BAUD RATE = 1200"
1890 LOCATE ,28:PRINT" 7   BAUD RATE = 2400"
1900 LOCATE ,28:PRINT" 8   BAUD RATE = 4800"
1910 LOCATE ,28:PRINT" 9   BAUD RATE = 9600"
1920 LOCATE 24,1:COLOR 0,7:PRINT" SPACE  ";:COLOR 5,0:PRINT" Menu   ";
1930 COLOR 0,7:PRINT" KEY ";:COLOR 5,0:PRINT" Select Baud Rate  ";
1940 K$=INKEY$
1950 IF MID$(K$,1,1)="1" THEN BAUD$="75":GOTO 1320
1960 IF MID$(K$,1,1)="2" THEN BAUD$="110":GOTO 1320
1970 IF MID$(K$,1,1)="3" THEN BAUD$="150":GOTO 1320
1980 IF MID$(K$,1,1)="4" THEN BAUD$="300":GOTO 1320
1990 IF MID$(K$,1,1)="5" THEN BAUD$="600":GOTO 1320
2000 IF MID$(K$,1,1)="6" THEN BAUD$="1200":GOTO 1320
2010 IF MID$(K$,1,1)="7" THEN BAUD$="2400":GOTO 1320
2020 IF MID$(K$,1,1)="8" THEN BAUD$="4800":GOTO 1320
2030 IF MID$(K$,1,1)="9" THEN BAUD$="9600":GOTO 1320
2040 IF MID$(K$,1,1)=CHR$(13) THEN 1320
2050 IF MID$(K$,1,1)=" " THEN 1320
2060 GOTO 1940
2070      REM: ?? DATIME
2080 DATIME$=DATE$+"  "+LEFT$(TIME$,5):RETURN
2090      REM: ?? PARALLEL
2100 CLS:LOCATE 23,1:COLOR 6,0:PRINT"WAIT - Printing to ";P$;" - Press * to ABORT";:ON ERROR GOTO 2450
2110 OPEN P$ AS #1:GOSUB 2080
2120    FOR I=1 TO NUM:LOCATE 24,1:PRINT I;:K$=INKEY$:IF MID$(K$,1,1)="*" THEN 2140
2130 PRINT #1,"OUTPUT PORT: ";P$;"  ";DATIME$:PRINT #1,A$;C$:PRINT #1,B$;D$:NEXT
2140 PRINT #1,CHR$(10):CLOSE #1:BEEP:GOTO 1310
2150      REM: ?? SERIAL
2160 CLS:LOCATE 23,1:COLOR 6,0:PRINT"WAIT - Printing to ";S$;" - Press * to ABORT";:ON ERROR GOTO 2450
2170 OPEN S$+BAUD$+SERIAL$ AS #1:GOSUB 2080
2180    FOR I=1 TO NUM:LOCATE 24,1:PRINT I;:K$=INKEY$:IF MID$(K$,1,1)="*" THEN 2200
2190 PRINT #1,"OUTPUT PORT: ";S$;"  ";DATIME$:PRINT #1,A$;C$:PRINT #1,B$;D$:NEXT
2200 PRINT #1,CHR$(10):CLOSE #1:BEEP:GOTO 1310
2210      REM: ?? CRT
2220 CLS:LOCATE 25,1:COLOR 6,0:PRINT "WAIT - Press * to ABORT";
2230 LOCATE 21,1:ON ERROR GOTO 2450
2240 OPEN "SCRN:" FOR OUTPUT AS #1:GOSUB 2080
2250    FOR I=1 TO NUM:K$=INKEY$:IF MID$(K$,1,1)="*" THEN 2270
2260 PRINT #1,"OUTPUT PORT: ";"SCRN:";"  ";DATIME$:PRINT #1,A$;C$:PRINT #1,B$;D$:NEXT
2270 CLOSE #1
2280 LOCATE 25,1:PRINT CL$;:LOCATE 25,1:COLOR 0,7:PRINT" SPACE ";:COLOR 5,0:PRINT " To Continue";
2290 K$=INKEY$: IF K$="" THEN 2290
2300 GOTO 1310
2310      REM: ?? SMART MODEM
2320 CLS:LOCATE 23,1:COLOR 6,0:PRINT"WAIT - Dialing Smart Modem on COM1:";:ON ERROR GOTO 2450
2330 OPEN MODEM$ AS #1
2340 PRINT #1,"AT ";X$;" D";NUMBER$:CLOSE #1
2350 SECONDS=5:IF X$="P" THEN SECONDS=14
2360 GOSUB 2380:CLS:LOCATE 23,1:PRINT"WAIT 30 Seconds for Hang Up";
2370 SECONDS=30:GOSUB 2380:GOTO 1310
2380      REM: ?? TIME
2390 TI$=TIME$:SEC1=VAL(MID$(T1$,7,2)): SEC=0
2400 K$=INKEY$:IF SEC=SECONDS THEN RETURN
2410 T2$=TIME$:SEC2=VAL(MID$(T2$,7,2)):IF SEC2<>SEC1 THEN SEC=SEC+1
2420 SEC1=SEC2:LOCATE 24,1:PRINT "TIME: ";SEC;:GOTO 2400
2430      REM: ?? RETURN
2440 RETURN
2450      REM: ?? ERROR
2460 CLS:LOCATE 21,1:COLOR 6,0:BEEP:CLOSE #1
2470 PRINT"MENU SELECTION: ";"(";K$;")":PRINT "ERROR NUMBER:  ";ERR;CHR$(10):RESUME 1260
2480     REM: ?? WIDTH
2490 CLS:LOCATE 24,1:COLOR 0,7:PRINT" ENTER ";:COLOR 5,0:PRINT" 40 Column Message  ";
2500 COLOR 0,7:PRINT" 8 ";:COLOR 5,0:PRINT" 80 Column Message";
2510 K$=INKEY$:IF MID$(K$,1,1)="8" THEN C$=A$:D$=B$:COL$="80":GOTO 1320
2520 IF K$="" THEN 2510
2530 C$="":D$="":COL$="40":GOTO 1320