1 COMMON A, AL, B, BASEONLY, C, C$, C1, CAT$, CC, CKT$, D, D$, DD, DIA, DIMN$, DMS, E, EO, EX$, F, F$, FD, FF, FQ, FRQ, G$, GO$, I, I$, L, LATLONG, LD, LL, LN, LS, LW, LX, MAX, MENU, MIN, MX, N, NN, NT, OV, P, PI, PROG$, Q, QQ, QU, R, RA, RC, T, T$, U, U$, UH, UL$, V$, VC, W, WHIP, WIRD, WW, X, X$, X1, XS, Z$, ZP, ZS
10 'COLCODE - Resistor Colour Code - 17 APR 96 rev.
20 IF EX$=""THEN EX$="EXIT"
30 CLS:KEY OFF
40 COLOR 7,0,0
50 DIM C$(9),R(24)
60 U$="####,###.###"
70 UL$=STRING$(80,205)
80 ER$=STRING$(29,32)
90 '
100 DATA BLACK,BROWN,RED,ORANGE,YELLOW,GREEN,BLUE,VIOLET,GREY,WHITE
110 FOR Z=0 TO 9
120 READ C$(Z)
130 NEXT Z
140 '
150 DATA 10,11,12,13,15,16,18,20,22,24,27,30
160 DATA 33,36,39,43,47,51,56,62,68,75,82,91
170 FOR Z=1 TO 24
180 READ R(Z)
190 NEXT Z
200 '
210 '.....start
220 CLS
230 COLOR 15,2
240 PRINT " RESISTOR COLOUR CODES";TAB(57);;"by George Murphy VE3ERP ";
250 COLOR 1,0:PRINT STRING$(80,223);
260 COLOR 7,0
270 LOCATE 4:T=27
280 LOCATE ,T:PRINT "             ³   "
290 LOCATE ,T:PRINT "           ÚÄÁÄ¿ "
300 LOCATE ,T:PRINT "           ÆÍÍÍµ "
310 LOCATE ,T:PRINT "           ÆÍÍÍµ "
320 LOCATE ,T:PRINT "           ÆÍÍÍµ "
330 LOCATE ,T:PRINT " Tolerance ÆÍÍÍµ®Ä Silver = 10%  Gold = 5% "
340 LOCATE ,T:PRINT "           ³   ³ "
350 LOCATE ,T:PRINT "           ÀÄÂÄÙ "
360 LOCATE ,T:PRINT "             ³   "
370 PRINT
380 PRINT UL$;
390 '
400 LOCATE 15
410 PRINT " Press number in < > to:"
420 LOCATE CSRLIN-1,19:COLOR 30,0:PRINT "þ"
430 COLOR 7,0
440 PRINT UL$;
450 PRINT "    < 1 > Find colour code for a specified value"
460 PRINT "    < 2 > Find value from colour code"
470 PRINT
480 PRINT "    < 0 > EXIT"
490 Z$=INKEY$
500 IF Z$="0"THEN CLS:RUN EX$
510 IF Z$="1"THEN 550
520 IF Z$="2"THEN 880
530 GOTO 490
540 '
550 '.....find colour code
560 VIEW PRINT 15 TO 24:CLS:VIEW PRINT:LOCATE 15
570 INPUT " ENTER: Value in ohms (minimum 10 ê).....";V
580 IF V<10 THEN BEEP:GOTO 560
590 VIEW PRINT 15 TO 24:CLS:VIEW PRINT:LOCATE 15
600 FOR M=0 TO 9       'multiplier
610 IF V/10^2>=10^(M) THEN 630
620 GOTO 650
630 NEXT M
640 '
650 SIG=INT(V/10^(M)+5.000000E-01)
660 C1=VAL(MID$(STR$(SIG),2,1)):C1$=C$(C1)
670 C2=VAL(MID$(STR$(SIG),3,1)):C2$=C$(C2)
680 C3$=C$(M)
690 R=SIG*10^(M)
700 LOCATE 6,T+16:PRINT "®Ä ";C1$+ER$
710 LOCATE 7,T+16:PRINT "®Ä ";C2$+ER$
720 LOCATE 8,T+16:PRINT "®Ä ";C3$+ER$
730 '
740 X=R:X$="ê"
750 IF R>=10^4 THEN X=R/10^3:X$="kê"
760 IF R>=10^6 THEN X=R/10^6:X$="megê"
770 LOCATE 11,T+18:PRINT ER$;"       "
780 LOCATE 12,T+14:PRINT ER$;"        "
790 COLOR 0,7
800 LOCATE 11,T+18:PRINT " R =";X;X$;" "
810 FOR Z=1 TO 24
820 IF R(Z)=SIG THEN 850
830 NEXT Z
840 LOCATE 12,T+14:PRINT " NON-STANDARD VALUE! "
850 COLOR 7,0
860 GOTO 400
870 '
880 '.....find resistance
890 VIEW PRINT 15 TO 24:CLS:VIEW PRINT:LOCATE 15
900 FOR Z=0 TO 9
910 PRINT TAB(35);"<";Z;;"> ";C$(Z);
920 NEXT Z
930 LOCATE 6,T+16:GOSUB 990:SIG=N*10
940 LOCATE 7,T+16:GOSUB 990:SIG=SIG+N
950 LOCATE 8,T+16:GOSUB 990:R=SIG*10^N
960 VIEW PRINT 15 TO 24:CLS:VIEW PRINT:LOCATE 15
970 GOTO 740
980 '
990 COLOR 0,7
1000 PRINT "®Ä Press digit in < > for colour "
1005 LOCATE CSRLIN-1,T+35
1010 COLOR 30,7:PRINT "þ"
1020 COLOR 7,0
1030 Z$=INKEY$:IF Z$=""THEN 1030
1040 N=VAL(Z$)
1050 C$=C$(N)
1060 LOCATE CSRLIN-1,T+16:PRINT "®Ä ";C$+ER$
1070 RETURN
