home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
basic
/
library
/
pb
/
library4
/
spectern.bas
< prev
next >
Wrap
BASIC Source File
|
1994-04-11
|
11KB
|
295 lines
'Program Name : Spectern.bas Example of Specter Factory Terminal
'Author : Lloyd L. Smith for Spectra Technical Support
'Date : 11-12-90
'Compuserve # : GO PCVENB, Vendor #12/Spectra, Tech Support ID 71530,2640
'Tech Support BBS: 813-625-1721, PC-Board, 8,N,1 USR HST 300 - 14.4, 24hrs
'Tech Support Fax: 813-625-1698 G2 & G3 compatible
'Tech Support Voc: 813-625-1172 Voice
'Concept Date : 07-07-88
'Concept by : SmithTronix Corporation
' : Advanced programming examples, few comments
' : Enter a six digit number to activate displays,
' : to exit Program, type stop.
DECLARE SUB Font ()
DECLARE SUB messages ()
SHARED d1$, d2$, d3$, d4$, d5$, d6$, d7$, d8$, d9$, d0$, SP$
SHARED P1$, P2$, P3$, P4$, P5$
SHARED FA$, FB$, Fc$, Fd$, Fe$, Ff$, Fg$, fh$, fi$, FJ$, Fk$, Fl$, Fm$
SHARED QN$, Fo$, FP$, FQ$, FR$, FS$, Ft$, Fu$, Fv$, Fw$, Fx$, Fy$, FZ$
SHARED msg$(), size, Letcolor
DIM msg$(30)
SCREEN 9
CALL messages
'blue border around entire screen
LINE (0, 0)-(639, 199), 7, BF
FOR I = 0 TO 4
LINE (I, 0)-(635 + I, 199), 11, B '9, B
NEXT I
'blue box around keypad
FOR I = 0 TO 4
LINE (25 + I, 35)-(345 + I, 185), 11, B'9, B
'LINE (25 + I, 35)-(350 + I, 185), 9, B
NEXT I
G = 15
FOR I = 0 TO 4
LINE (30 + I + G, 40)-(70 + I + G, 60), 11, B '9, B
LINE (31 + I + G, 41)-(69 + I + G, 59), 0, BF '9, B
G = G + 60
NEXT I
G = 15
FOR I = 0 TO 4
LINE (30 + I + G, 70)-(70 + I + G, 90), 11, B'9, B
LINE (31 + I + G, 71)-(69 + I + G, 89), 0, BF'9, B
G = G + 60
NEXT I
G = 15
FOR I = 0 TO 4
LINE (30 + I + G, 100)-(70 + I + G, 120), 11, B'9, B
LINE (31 + I + G, 101)-(69 + I + G, 119), 0, BF'9, B
G = G + 60
NEXT I
G = 15
FOR I = 0 TO 4
LINE (30 + I + G, 130)-(70 + I + G, 150), 11, B '9, B
LINE (31 + I + G, 131)-(69 + I + G, 149), 0, BF '9, B
G = G + 60
NEXT I
COLOR 14, 0
LOCATE 2, 20
PRINT "Specter"
COLOR 15, 0
CALL Font
CALL messages
GOSUB check
PSET (450, 8), 0: DRAW msg$(1)
PSET (550, 8), 0: DRAW msg$(2)
PSET (500, 52), 0: DRAW msg$(3)
PSET (355, 70), 7: DRAW msg$(4)
PSET (355, 80), 7: DRAW msg$(5)
PSET (355, 90), 7: DRAW msg$(6)
PSET (500, 60), 7: DRAW msg$(7)
PSET (500, 105), 0: DRAW msg$(8)
PSET (500, 152), 0: DRAW msg$(9)
PSET (355, 176), 0: DRAW msg$(10)
PSET (55, 50), 0: DRAW msg$(11) 'tl
'Numbers on the keypad
PSET (125, 50), 0: DRAW d1$ '#1
PSET (185, 50), 0: DRAW d2$ '#2
PSET (245, 50), 0: DRAW d3$ '#3
PSET (291, 50), 0: DRAW msg$(13) 'scale
PSET (291, 58), 0: DRAW msg$(14) 'raw
PSET (47, 80), 0: DRAW msg$(15)
PSET (125, 80), 0: DRAW d4$ '#4
PSET (185, 80), 0: DRAW d5$ '#5
PSET (245, 80), 0: DRAW d6$ '#6
PSET (291, 78), 0: DRAW msg$(16) 'force
PSET (291, 88), 0: DRAW msg$(17) 'next
PSET (47, 110), 0: DRAW msg$(18) 'clear
PSET (125, 110), 0: DRAW d7$ '#7
PSET (185, 110), 0: DRAW d8$ '#8
PSET (245, 110), 0: DRAW d9$ '#9
PSET (291, 108), 0: DRAW msg$(19) 'unforce
PSET (291, 118), 0: DRAW msg$(20) 'prev
PSET (230, 138), 0: DRAW msg$(23) 'ack
PSET (230, 148), 0: DRAW msg$(24)'test
PSET (185, 140), 0: DRAW d0$ '#0
PSET (291, 138), 0: DRAW msg$(25) 'shift
' Pattern used for seven segment display
' 2
' --
' 1| 4|3
' --
' 5| 7|6
' --
idle:
x = 434: y = 16
Fg = 12: bg = 0
again:
LOCATE 16, 2: PRINT " "
LOCATE 16, 2: INPUT kb$
IF UCASE$(kb$) = "STOP" THEN CLS : SYSTEM
IF LEN(kb$) > 6 OR LEN(kb$) < 6 THEN GOTO again
for z=1 to 5
FOR I = 1 TO LEN(kb$)
A = VAL(MID$(kb$, I, 1))
' 1234567
IF A = 1 THEN pat$ = "0010010"
IF A = 2 THEN pat$ = "0111101"
IF A = 3 THEN pat$ = "0111011"
IF A = 4 THEN pat$ = "1011010"
IF A = 5 THEN pat$ = "1101011"
IF A = 6 THEN pat$ = "1001111"
IF A = 7 THEN pat$ = "0110010"
IF A = 8 THEN pat$ = "1111111"
IF A = 9 THEN pat$ = "1111011"
IF A = 0 THEN pat$ = "1110111"
'left side of seven segment
IF MID$(pat$, 1, 1) = "1" THEN LINE (x, y)-(x + 1, y + 10), Fg, BF ELSE LINE (x, y)-(x + 1, y + 10), bg, BF
IF MID$(pat$, 5, 1) = "1" THEN LINE (x, y + 12)-(x + 1, y + 22), Fg, BF ELSE LINE (x, y + 12)-(x + 1, y + 22), bg, BF
'top line of seven segment display
IF MID$(pat$, 2, 1) = "1" THEN LINE (x + 3, y)-(x + 19, y), Fg ELSE LINE (x + 3, y)-(x + 19, y), bg
'middle line of seven segment display
IF MID$(pat$, 4, 1) = "1" THEN LINE (x + 3, y + 11)-(x + 19, y + 11), Fg ELSE LINE (x + 3, y + 11)-(x + 19, y + 11), bg
'bottom line of seven segement display
IF MID$(pat$, 7, 1) = "1" THEN LINE (x + 3, y + 22)-(x + 19, y + 22), Fg ELSE LINE (x + 3, y + 22)-(x + 19, y + 22), bg
'right side of seven segment
IF MID$(pat$, 3, 1) = "1" THEN LINE (x + 21, y)-(x + 22, y + 10), Fg, BF ELSE LINE (x + 21, y)-(x + 22, y + 10), bg, BF
IF MID$(pat$, 6, 1) = "1" THEN LINE (x + 21, y + 12)-(x + 22, y + 22), Fg, BF ELSE LINE (x + 21, y + 12)-(x + 22, y + 22), bg, BF
x = x + 30
NEXT I
if z=1 then x=434
if z=2 then x=434:y=y+53
if z=3 then x=434:y=y+47
if z=4 then x=434:y=y+50
next z
GOTO idle
check:
FOR I = 1 TO 4
IF I = 1 THEN W = 420: V = 10: H = 31
IF I = 2 THEN W = 420: V = 63: H = 31
IF I = 3 THEN W = 420: V = 110: H = 31
IF I = 4 THEN W = 420: V = 160: H = 31
LINE (W, V)-(W + 200, V), 8
LINE (W + 1, V + 1)-(W + 200, V + 1), 8
LINE (W + 2, V + 2)-(W + 200, V + 2), 8
LINE (W + 3, V + 3)-(W + 200, V + 3), 8
LINE (W, V + 1)-(W, V + H), 15
LINE (W + 1, V + 2)-(W + 1, V + H), 15
LINE (W + 2, V + 3)-(W + 2, V + H), 15
LINE (W + 3, V + 4)-(W + 3, V + H), 15
LINE (W + 4, V + 5)-(W + 4, V + H), 15
LINE (W, V + H)-(W + 197, V + H), 15
LINE (W, V + H + 1)-(W + 198, V + H + 1), 15
LINE (W, V + H + 2)-(W + 199, V + H + 2), 15
LINE (W, V + H + 3)-(W + 200, V + H + 3), 15
LINE (W + 196, V)-(W + 196, V + H - 1), 8
LINE (W + 197, V)-(W + 197, V + H), 8
LINE (W + 198, V)-(W + 198, V + H + 1), 8
LINE (W + 199, V)-(W + 199, V + H + 2), 8
LINE (W + 200, V)-(W + 200, V + H + 3), 8
LINE (W + 201, V)-(W + 201, V + H + 3), 8
'make the hole
LINE (W + 5, V + 4)-(W + 195, V + H - 1), 0, BF
NEXT I
RETURN
SUB Font STATIC
'Draw Font Character Set - Hand edited
size = 4: Letcolor = 14
FA$ = "S=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br1u4e2f2d2l4r4d2br2"
FB$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br1u6r3f1d1G1l2br2F1d1g1l3br6"
Fc$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br5BU5H1L2G1D4F1R2E1BF1BR1"
Fd$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6R3F1D4G1L3BR6"
Fe$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6R4BD3BL2L2D3R4BR2"
Ff$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6R4BD3BL2L2BD3BR6"
Fg$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br5BU5H1L2G1D4F1R2E1U1L1BD2BR3"
fh$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6BD3R4BU3D6BR2"
fi$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1R1U6L1R2L1D6R1BR2"
FJ$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR5BU6D5G1L2H1BD1BR6"
Fk$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6BR4G3F3BR2"
Fl$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6BD6R4BR2"
Fm$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6F3E3D6BR2"
QN$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6F6U6BD6BR2"
Fo$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br5BU5H1L2G1D4F1R2E1U4BD5BR2"
FP$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6R4F1D1G1L2BD3BR5"
FQ$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br5BU5H1L2G1D4F1R2E1U4BD4H1F2BR2"
FR$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1U6R3F1D1G1L2F3BR2"
FS$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR5BU5H1L2G1D1F1R2F1D1G1L2H1BD1BR6"
Ft$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU6R4L2D6BR4"
Fu$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU6D5F1R2E1U5BD6BR2"
Fv$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU6D4F2E2U4BD6BR2"
Fw$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU6D6E2F2U6BD6BR2"
Fx$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1E6BL6F6BR2"
Fy$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU6F2E2BG2D4BR4"
FZ$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU6R6G6R6BR2"
d1$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU5E1D6L1R2BR2"
d2$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU5E1R2F1D1G4R4BR2"
d3$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU6R4G2F2D1G1L2H1BD1BR6"
d4$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR4U6G3R4BD3BR2"
d5$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU1F1R2E1U1H1L3U3R4BD6BR2"
d6$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR3BU6L1G1D4F1R2E1U1H1L2G1BD2BR6"
d7$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU6R4G3D3BR4"
d8$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR1BU1U1E1R2E1U1H1L2G1D1F1R2F1D1G1L2H1BD1BR6"
d9$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "BR5BU4G1L2H1U1E1R2F1D4G1L1BR4"
d0$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br5BU5H1L2G1D4F1R2E1U4BD5BR2"
SP$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br7"
P1$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br2L1U1R1D1BR2"
P2$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br2L1U1R1D2G1BE1BU1BR2"
P3$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br2L1U1R1D1BU4L1U1R1D1BD4BR2"
P4$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br2L1U1R1D2G1BE1BU5L1U1R1D1BD4BR2"
P5$ = "s=" + VARPTR$(size) + "c=" + VARPTR$(Letcolor) + "br1BU5E1R2F1D1H1L1D1BD2R1BR3"
END SUB
SUB messages STATIC
'Text Messages using Draw Chatacter Fonts
msg$(1) = Fm$ + Fw$ + SP$ + Ft$ + Fy$ + FP$ + Fe$
msg$(2) = FA$ + Fd$ + Fd$ + FR$ + Fe$ + FS$ + FS$
msg$(3) = Fl$ + Fo$ + Fc$ + FA$ + Ft$ + fi$ + Fo$ + QN$
msg$(4) = FA$ + Fl$ + FA$ + FR$ + Fm$
msg$(5) = Ff$ + Fo$ + FR$ + Fc$ + Fe$ + Fd$
msg$(6) = FP$ + FR$ + Fo$ + Ft$ + Fe$ + Fc$ + Ft$ + Fe$ + Fd$
msg$(7) = FP$ + P1$ + Fu$ + P1$ + SP$ + FP$ + Fc$ + SP$ + QN$ + Fo$
msg$(8) = Ft$ + FA$ + Fg$ + SP$ + Fd$ + SP$ + Ft$ + Fy$ + FP$ + Fe$
msg$(9) = FP$ + FR$ + Fe$ + FS$ + Fe$ + Ft$
msg$(10) = Fc$ + Fu$ + FR$ + FR$ + Fe$ + QN$ + Ft$
msg$(11) = Ft$ + P1$ + Fl$
msg$(12) = FR$ + FA$ + FP$
msg$(13) = FS$ + Fc$ + FA$ + Fl$ + Fe$
msg$(14) = FR$ + FA$ + Fw$
msg$(15) = Fe$ + QN$ + Ft$ + Fe$ + FR$
msg$(16) = Ff$ + Fo$ + FR$ + Fc$ + Fe$
msg$(17) = QN$ + Fe$ + Fx$ + Ft$
msg$(18) = Fc$ + Fl$ + Fe$ + FA$ + FR$
msg$(19) = Fu$ + QN$ + Ff$ + FR$ + Fc$
msg$(20) = FP$ + FR$ + Fe$ + Fv$
msg$(21) = Fc$ + fh$ + FA$ + QN$ + Fg$ + Fe$
msg$(22) = FR$ + Fu$ + QN$
msg$(23) = FA$ + Fc$ + Fk$
msg$(24) = Ft$ + Fe$ + FS$ + Ft$
msg$(25) = FS$ + fh$ + fi$ + Ff$ + Ft$
END SUB