home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib38b.dsk
/
TICKET.KIT.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
10KB
|
209 lines
10 REM *************************
20 REM * TICKET.KIT *
30 REM * BY VAL ADKINS *
40 REM * COPYRIGHT(C) 1989 *
50 REM * MINDCRAFT PUBL. CORP. *
60 REM * CONCORD, MA 01742 *
70 REM *************************
80 PRINT CHR$(21): REM SETS DISPLAY TO 40 COLUMNS
90 HOME
100 REM TITLE SCREEN
110 BD$ = CHR$(36)
120 FOR X = 1 TO 39: PRINT BD$;: NEXT X: PRINT
130 FOR X = 1 TO 18: PRINT BD$; SPC( 37);BD$: NEXT X
140 FOR X = 1 TO 39: PRINT BD$;: NEXT X
150 VTAB 5: HTAB 16: PRINT "TICKET KIT": VTAB 7: HTAB 15: PRINT "BY VAL ADKINS": VTAB 9: HTAB 13: PRINT "COPYRIGHT(C) 1989": VTAB 11: HTAB 10: PRINT "BY MINDCRAFT PUBL. CORP."
160 GOSUB 2010
170 HOME
180 REM INSTRUCTIONS
190 VTAB 2: PRINT "THIS PROGRAM WILL PRINT ADMISSION"
200 VTAB 4: PRINT "TICKETS OR NUMBERED RAFFLE TICKETS."
210 VTAB 6: PRINT "YOU WILL BE PROMPTED TO ENTER THE"
220 VTAB 8: PRINT "SLOT NUMBER OF YOUR PRINTER AND THE"
230 VTAB 10: PRINT "TYPE OF TICKET TO BE CREATED. YOU WILL"
240 VTAB 12: PRINT "THEN BE ASKED TO ENTER THE TEXT TO BE"
250 VTAB 14: PRINT "PRINTED ON THE TICKETS. YOU WILL BE"
260 VTAB 16: PRINT "LIMITED TO 20 CHARACTERS ON THE FIRST"
270 VTAB 18: PRINT "LINE AND 40 CHARACTERS ON THE OTHER"
280 VTAB 20: PRINT "SEVEN LINES. SIMPLY FOLLOW THE PROMPTS."
290 GOSUB 2010
300 HOME : VTAB 10: INPUT "PLEASE ENTER YOUR PRINTER SLOT #";SL$
310 HOME :SL = VAL(SL$): IF SL <1 OR SL >7 THEN 300
320 VTAB 8: PRINT "DO YOU WISH TO CREATE"
330 VTAB 12: PRINT "A) RAFFLE TICKETS"
340 VTAB 14: PRINT "B) ADMISSION TICKETS"
350 VTAB 18: HTAB 4: INPUT "YOUR CHOICE ";TK$
360 TK$ = LEFT$(TK$,1)
370 IF TK$ < >"A" AND TK$ < > CHR$(97) AND TK$ < >"B" AND TK$ < > CHR$(98) THEN 350
380 HOME
390 REM INPUT TICKET INFORMATION
400 GOSUB 1700
410 VTAB 8: PRINT "THE INFORMATION YOU ENTERED WILL BE"
420 VTAB 10: PRINT "FORMATTED IN THE FOLLOWING MANNER."
430 GOSUB 2010
440 HOME
450 FOR CK = 1 TO 8
460 LS = LEN(K$(CK))
470 PRINT SPC( (40 -LS)/2)K$(CK)
480 IF CK = 1 THEN PRINT
490 NEXT CK
500 VTAB 22: INPUT "IS THIS CORRECT? (Y/N) ";YN$
510 YN$ = LEFT$(YN$,1)
520 IF YN$ < >"Y" AND YN$ < > CHR$(121) AND YN$ < >"N" AND YN$ < > CHR$(110) THEN 500
530 IF YN$ = "N" OR YN$ = CHR$(110) THEN FOR CR = 1 TO 8:K$(CR) = "": NEXT CR: GOTO 400
540 HOME
550 A$ = K$(1)
560 B$ = K$(2)
570 C$ = K$(3)
580 D$ = K$(4)
590 E$ = K$(5)
600 F$ = K$(6)
610 G$ = K$(7)
620 H$ = K$(8)
630 NM$ = "NAME"
640 ADR$ = "ADDRESS"
650 TEL$ = "PHONE"
660 VL$ = CHR$(252)
670 HL$ = "-------------------------------------------------------------------------------": REM 79 DASHES
680 ESC$ = CHR$(27):TC$ = ESC$ +"E": REM THIS PRINTS 12 CPI
690 DW$ = CHR$(14): REM THIS PRINTS DOUBLE WIDTH CHARACTERS, IN THIS CASE 6 CPI
700 EDW$ = CHR$(15): REM THIS ENDS DOUBLE WIDTH PRINTING
710 IF TK$ = "A" OR TK$ = CHR$(97) THEN GOSUB 750
720 IF TK$ = "B" OR TK$ = CHR$(98) THEN GOSUB 1190
730 END
740 REM PRINT RAFFLE TICKETS
750 HOME : VTAB 6: INPUT "FIRST TICKET NUMBER: ";FT$
760 FT = VAL(FT$): IF FT <1 THEN 750
770 VTAB 8: INPUT "LAST TICKET NUMBER: ";LT$
780 LT = VAL(LT$): IF LT <1 OR LT <FT THEN 770
790 HOME : VTAB 12: PRINT "TICKETS WILL BE NUMBERED CONSECUTIVELY": PRINT : PRINT SPC( 18)"FROM": PRINT : PRINT SPC( 16)FT;" TO ";LT
800 VTAB 23: INPUT "IS THIS CORRECT? (Y/N) ";YN$
810 YN$ = LEFT$(YN$,1)
820 IF YN$ < >"Y" AND YN$ < > CHR$(121) AND YN$ < >"N" AND YN$ < > CHR$(110) THEN 800
830 IF YN$ = "N" OR YN$ = CHR$(110) THEN 750
840 HOME : VTAB 12: PRINT "PLEASE BE SURE YOUR PRINTER IS READY.": GOSUB 2010
850 HOME
860 PRINT CHR$(4);"PR#";SL$
870 PRINT : PRINT TC$;: REM 12CPI
880 PRINT HL$
890 XX = 4
900 FOR A = FT TO LT
910 PRINT SPC( 25)VL$
920 PRINT SPC( 25)VL$;
930 PRINT DW$;: REM DOUBLE WIDTH CHARACTERS
940 PRINT SPC( (28 - LEN(A$))/2)A$
950 PRINT EDW$;: REM END DOUBLE WIDTH
960 PRINT TC$;: REM 12 CPI
970 PRINT SPC( 25)VL$
980 PRINT NM$; SPC( 21)VL$;: PRINT SPC( (56 - LEN(B$))/2)B$
990 PRINT SPC( 25)VL$;: PRINT SPC( (56 - LEN(C$))/2)C$
1000 PRINT ADR$; SPC( 18)VL$;: PRINT SPC( (56 - LEN(D$))/2)D$
1010 PRINT SPC( 25)VL$;: PRINT SPC( (56 - LEN(E$))/2)E$
1020 PRINT TEL$; SPC( 20)VL$;: PRINT SPC( (56 - LEN(F$))/2)F$
1030 PRINT SPC( 25)VL$;: PRINT SPC( (56 - LEN(G$))/2)G$
1040 PRINT SPC( 25)VL$;: PRINT SPC( (56 - LEN(H$))/2)H$
1050 IF A < = 9 AND A > = 1 THEN PRINT A; SPC( 24)VL$; SPC( 42)A
1060 IF A < = 99 AND A > = 10 THEN PRINT A; SPC( 23)VL$; SPC( 42)A
1070 IF A < = 999 AND A > = 100 THEN PRINT A; SPC( 22)VL$; SPC( 42)A
1080 IF A > = 1000 THEN PRINT A; SPC( 21)VL$; SPC( 42)A
1090 PRINT HL$
1100 IF A = FT +XX THEN PRINT CHR$(12)
1110 IF A = FT +XX AND A < >LT THEN PRINT HL$
1120 IF A = FT +XX THEN XX = XX +5
1130 IF A = LT THEN PRINT CHR$(12)
1140 IF PEEK( -16384) = 155 THEN 2020
1150 NEXT A
1160 PRINT CHR$(4);"PR#0"
1170 HOME : GOSUB 1550
1180 REM PRINT ADMISSION TICKETS
1190 HOME : VTAB 10: INPUT "PRINT HOW MANY TICKETS? ";NT$
1200 NT = VAL(NT$)
1210 IF NT <1 THEN 1190
1220 HOME : VTAB 12: HTAB 10: PRINT "PRINTING ";NT;" TICKETS."
1230 VTAB 16: HTAB 10: INPUT "IS THIS CORRECT? (Y/N) ";YN$
1240 YN$ = LEFT$(YN$,1)
1250 IF YN$ < >"Y" AND YN$ < > CHR$(121) AND YN$ < >"N" AND YN$ < > CHR$(110) THEN 1230
1260 IF YN$ = "N" OR YN$ = CHR$(110) THEN 1190
1270 HOME : VTAB 12: PRINT "PLEASE BE SURE YOUR PRINTER IS READY.": GOSUB 2010
1280 HOME
1290 PRINT CHR$(4);"PR#";SL$
1300 PRINT TC$: REM 12 CPI
1310 PRINT HL$
1320 XX = 4
1330 FOR A = 1 TO NT
1340 PRINT
1350 PRINT DW$;: REM DOUBLE WIDTH
1360 PRINT SPC( (30 - LEN(A$))/2)A$
1370 PRINT EDW$;: REM END DOUBLE WIDTH
1380 PRINT TC$;: REM 12 CPI
1390 FOR PT = 2 TO 8
1400 AD = LEN(K$(PT))
1410 PRINT SPC( (60 -AD)/2)K$(PT)
1420 NEXT PT
1430 PRINT
1440 PRINT HL$
1450 IF A = XX +1 THEN PRINT CHR$(12)
1460 IF A = NT THEN PRINT CHR$(12): GOTO 1500
1470 IF A = XX +1 THEN PRINT HL$
1480 IF A = XX +1 THEN XX = XX +5
1490 IF PEEK( -16384) = 155 THEN 2060
1500 NEXT A
1510 PRINT CHR$(4);"PR#0"
1520 HOME : GOSUB 1550
1530 RETURN
1540 REM CONTINUE OR QUIT
1550 VTAB 12: INPUT "PRINT MORE TICKETS? (Y/N) ";YN$
1560 YN$ = LEFT$(YN$,1)
1570 IF YN$ < >"Y" AND YN$ < > CHR$(121) AND YN$ < >"N" AND YN$ < > CHR$(110) THEN 1550
1580 IF YN$ = "N" OR YN$ = CHR$(110) THEN HOME : END
1590 IF YN$ = "Y" OR YN$ = CHR$(121) THEN HOME : VTAB 6: PRINT "WOULD YOU LIKE TO..."
1600 VTAB 9: HTAB 4: PRINT "<A> USE THE SAME TEXT."
1610 VTAB 11: HTAB 4: PRINT "<B> CHANGE THE TEXT."
1620 VTAB 15: HTAB 4: INPUT "YOUR CHOICE? ";CH$
1630 CH$ = LEFT$(CH$,1)
1640 IF CH$ < >"A" AND CH$ < > CHR$(97) AND CH$ < >"B" AND CH$ < > CHR$(98) THEN 1620
1650 IF CH$ = "B" OR CH$ = CHR$(98) THEN HOME : FOR CT = 1 TO 8:K$(CT) = "": NEXT CT: GOTO 320
1660 IF (CH$ = "A" OR CH$ = CHR$(97)) AND (TK$ = "A" OR TK$ = CHR$(97)) THEN A = 0: GOTO 750
1670 IF (CH$ = "A" OR CH$ = CHR$(97)) AND (TK$ = "B" OR TK$ = CHR$(98)) THEN A = 0: GOTO 1190
1680 RETURN
1690 REM INPUT ROUTINE
1700 B$ = CHR$(136):U$ = CHR$(223)
1710 FOR I = 1 TO 40:BB$ = BB$ + CHR$(136):UU$ = UU$ + CHR$(95): NEXT I
1720 NL = 1
1730 HOME : VTAB 10:L = 20: PRINT "LINE #";NL: PRINT : GOSUB 1790: PRINT
1740 FOR NL = 2 TO 8
1750 HOME : VTAB 10:L = 40: PRINT "LINE #";NL: PRINT : GOSUB 1790: PRINT
1760 NEXT NL
1770 HOME
1780 RETURN
1790 IF K$(NL) = "" THEN 1840
1800 BU$ = LEFT$(BB$, LEN(K$(NL)) +1) + LEFT$(UU$,L) + LEFT$(BB$,L): PRINT K$(NL): INVERSE : PRINT " ";: NORMAL
1810 WAIT -16384,128:K = PEEK( -16384): IF K = 141 OR K = 155 THEN PRINT B$" ";: POKE -16368,0: RETURN
1820 IF K <160 OR K = 255 THEN 1790
1830 PRINT BU$;:LI = 0:K$(NL) = "": INVERSE : PRINT " ";: NORMAL : PRINT B$;: GOTO 1980
1840 PRINT LEFT$(UU$,L) LEFT$(BB$,L);:LI = 0:K$(NL) = "": POKE -16368,0: INVERSE : PRINT " ";: NORMAL : PRINT B$;
1850 POKE -16368,0
1860 K = PEEK( -16384): IF K <128 THEN 1860
1870 IF K >159 AND K < >255 THEN 1990
1880 IF K = 141 THEN FOR K = LI TO L: PRINT " ";: NEXT K: POKE -16368,0: RETURN
1890 IF K < >155 THEN 1930
1900 IF LI = 0 THEN K$(NL) = CHR$(27): PRINT U$;: POKE -16368,0: RETURN
1910 IF LI = L THEN PRINT " ";: PRINT B$;
1920 PRINT LEFT$(BB$,LI);: GOTO 1840
1930 IF (K < >136 AND K < >255) THEN 1980
1940 IF LI = 0 THEN PRINT CHR$(7);: GOTO 1850
1950 IF LI = 1 THEN PRINT B$;: PRINT U$U$;: PRINT B$;: PRINT B$;: INVERSE : PRINT " ";: NORMAL : PRINT B$;:LI = LI -1:K$(NL) = "": GOTO 1850
1960 IF LI = L THEN PRINT B$;: PRINT U$" ";: PRINT B$B$;: INVERSE : PRINT " ";: NORMAL : PRINT B$;:LI = LI -1:K$(NL) = LEFT$(K$(NL),LI): GOTO 1850
1970 PRINT B$;: PRINT U$U$;: PRINT B$;: PRINT B$;: INVERSE : PRINT " ";: NORMAL : PRINT B$;:LI = LI -1:K$(NL) = LEFT$(K$(NL),LI): GOTO 1850
1980 IF K <160 THEN 1850
1990 IF LI = L THEN PRINT CHR$(7);: GOTO 1850
2000 PRINT CHR$(K);: INVERSE : PRINT " ";: NORMAL : PRINT B$;:K$(NL) = K$(NL) + CHR$(K):LI = LI +1: GOTO 1850
2010 VTAB 23: PRINT "PLEASE PRESS RETURN WHEN READY.": POKE 49168,0: WAIT 49152,128: RETURN
2020 GOSUB 2090
2030 GET CN$: IF CN$ = CHR$(13) THEN PRINT CHR$(4)"PR#1": POKE -16368,0: GOTO 1150
2040 IF CN$ = CHR$(27) THEN POKE -16368,0: GOTO 1160
2050 GOTO 2020
2060 GOSUB 2090: GET CN$: IF CN$ = CHR$(13) THEN PRINT CHR$(4)"PR#1": POKE -16368,0: GOTO 1500
2070 IF CN$ = CHR$(27) THEN POKE -16368,0: GOTO 1510
2080 GOTO 2060
2090 POKE -16368,0: PRINT CHR$(4)"PR#0": VTAB 23: HTAB 1: PRINT "PRESS RETURN TO CONTINUE, ESC TO QUIT";: RETURN