start tok64 d64-mOXJql 10 REM *** lfs form maker2 *** 20 REM 30 REM 5/31/87 version 40 REM 50 REM copyright, 1987 60 REM louis f. sander 70 REM 153 mayer drive 80 REM pittsburgh, pa 15237 90 REM 120 REM *** main loop 130 GOSUB190:REM initialize 140 GOSUB270:REM main menu 150 ON a GOSUB390,640,930,1250,1470:REM menu selections 160 RUN 170 : 180 REM *** initialize 190 DIM cw%(255),ll$(255),rl$(255) 200 pw=80:pi=11:k1=631:k2=198:IFPEEK(65534)<>72THENk1=842:k2=208:REM 64or128? 210 em$="{down}{space*7}{yellow}{reverse on} error! must be at least 1 {white}{down}":q$=CHR$(34) 220 r$=CHR$(13):tl$="{clear}{yellow}{cm @*40}" 230 POKE53280,6:POKE53281,6 240 RETURN 250 : 260 REM *** main menu 270 PRINTtl$;"{reverse on} lfs form maker - louis f. sander - 5/87{reverse off}{sh space}" 280 PRINT"{down}{light green}this lets you design forms. select:{down}{white}" 290 PRINT"{down}{space*4}1 - create a new form 300 PRINT"{down}{space*4}2 - edit an existing form 310 PRINT"{down}{space*4}3 - print an existing form 320 PRINT"{down}{space*4}4 - instructions 330 PRINT"{down}{space*4}5 - store menu 340 GETa$:IFa$=""THEN340 350 a=VAL(a$):IFa<1ORa>5THEN340 360 RETURN 370 : 380 REM *** create 390 PRINTtl$;"{reverse on}{space*11}create a new form{space*12}{reverse off}{sh space}" 400 PRINT"{light green}this lets you create a new form and 410 PRINT"save it onto your disk. 420 PRINT"{down}press to return to the menu, 430 PRINT"or press any other key to continue{.*3} 440 GETa$:IFa$=""THEN440 450 IFa$=r$THEN610 460 GOSUB1660 470 INPUT"{space*5}{white}{down}print a copy now (y or n){space*2}y{left*3}";a$ 480 IFLEFT$(a$,1)="y"THENGOSUB960 490 PRINT"{down}{light green}to save the form as a file on the disk, 500 PRINT"you must give it a unique file name of" 510 PRINT"14 characters or fewer. 520 PRINT"{down}saved forms can easily be printed or 530 PRINT"edited using options from the main menu. 540 PRINT"enter the form name now, or press 550 PRINT" to return to the menu. 560 PRINTTAB(15);"{down*2}{light gray}{cm t*14}{up*2}" 570 f$="":INPUT"{white}{space*4}form name";f$:f$="f/"+f$:IFf$="f/"THENRUN 580 OPEN15,8,15:OPEN2,8,2,f$+",s,w" 590 INPUT#15,a,a$:IFa>19THENCLOSE2:CLOSE15:PRINT"{down}{reverse on}{yellow} ";a$;" ":GOTO560 600 GOSUB2500 610 RETURN 620 : 630 REM *** edit 640 PRINTtl$;"{reverse on}{space*9}edit an existing form{space*10}{reverse off}{sh space}" 650 PRINT"{light green}this lets you load and modify an 660 PRINT"existing form. you can then save it 670 PRINT"under the same name or a new one. 680 GOSUB1510 690 of$=f$ 700 GOSUB1660 710 INPUT"{space*5}{white}{down}print a copy now (y or n){space*2}y{left*3}";a$ 720 IFLEFT$(a$,1)="y"THENGOSUB960 730 PRINT"{down}{light green}to save the form as a file on the disk, 740 PRINT"you must give it a unique file name of" 750 PRINT"14 characters or fewer. 760 PRINT"{down}saved forms can easily be printed or 770 PRINT"edited using options from the main menu. 780 PRINT"{light green}enter the new name under which you want 790 PRINT"to save the edited form, or press 800 PRINT" to return to the main menu." 810 PRINT"{down}'{white}@{light green}' will save it under its original 820 PRINT"name, which is {white}";MID$(of$,3);"{light green}" 830 PRINTTAB(15);"{down*2}{light gray}{cm t*14}{up*2}" 840 f$="":INPUT"{white}{space*4}form name";f$:f$="f/"+f$ 850 IFf$="f/"THEN900 860 OPEN15,8,15:IFf$="f/@"THENf$=of$:PRINT#15,"s0:"+f$ 870 OPEN2,8,2,f$+",s,w" 880 INPUT#15,a,a$:IFa>19THENCLOSE2:CLOSE15:PRINT"{down}{reverse on}{yellow} ";a$;" ":GOTO830 890 GOSUB2500 900 RETURN 910 : 920 REM *** print 930 PRINTtl$;"{reverse on}{space*9}print an existing form{space*9}{reverse off}{sh space}" 940 PRINT"{light green}this lets you load and print a form thathas been saved on the disk. 950 GOSUB1510 960 PRINT"{down}{light green}the form is" LEFT$(STR$((lw+w)/10),5);q$;" wide by"; 970 PRINTLEFT$(STR$(tl%/9),5);q$;" long," 980 PRINT"or";lw+w;"spaces wide by";tl%;"lines long.{down}" 990 PRINT"{light green}";:OPEN15,4,15:CLOSE15:IFstTHENPRINT"put the printer online, 1000 PRINT"align the paper in the printer, 1010 PRINT"then press the '{white}p{light green}' key{.*3}{space*10}{white}" 1020 GETa$:IFa$<>"p"THEN1020 1030 OPEN15,4,15:CLOSE15:IFstTHENPRINT"{down}{yellow}{reverse on} printer is offline! {down}":GOTO990 1040 tx$=CHR$(15) :REM text mode 1050 gr$=CHR$(8) :REM graphics mode (for line spacing) 1060 OPEN4,4:GOSUB1200:PRINT#4,lw$;cl$ 1070 FORh=1TOnr%:GOSUB1220;:FORj=1TOnc%:PRINT#4,CHR$(207);:FORk=1TOcw%(j)-1 1080 IFcw%(j)>1THENPRINT#4,CHR$(163); 1090 NEXT:NEXT:PRINT#4,CHR$(165);gr$:IFlr%<2THEN1130 1100 FORi=1TOlr%-1:GOSUB1220;:FORj=1TOnc%:PRINT#4,CHR$(165);:FORk=1TOcw%(j)-1 1110 IFcw%(j)>1THENPRINT#4," "; 1120 NEXT:NEXT:PRINT#4,CHR$(165);gr$:NEXT 1130 NEXT:GOSUB1220;:FORj=1TOnc%:FORk=1TOcw%(j):PRINT#4,CHR$(163);:NEXT:NEXT 1140 PRINT#4:CLOSE4 1150 INPUT"{white}{down}print another copy (y or n){space*2}n{left*3}";a$ 1160 IFLEFT$(a$,1)="y"THENlc=0:PRINT:GOTO990 1170 RETURN 1180 : 1190 REM puts row labels in place 1200 FORj=1TOtl%:ll$(j)=lw$:NEXT 1210 ln=1:FORk=1+INT((lr%-1)/2)TOtl%-1STEPlr%:ll$(k)=rl$(ln):ln=ln+1:NEXT 1220 PRINT#4,tx$;ll$(lc);:lc=lc+1:RETURN:REM row labels 1230 : 1240 REM *** instructions 1250 PRINT"{clear}{white}this lets you make forms on the printer:{sh space*2}" 1260 PRINT"{space*12}column 1{space*4}column 2" 1270 PRINT"{space*10}O{cm y*10}O{cm y*13}{cm g}" 1280 PRINT"{space*4}row 1 {cm g}{space*10}{cm g}{space*13}{cm g}" 1290 PRINT"{space*10}O{cm y*10}O{cm y*13}{cm g}" 1300 PRINT"{space*4}row 2 L{cm p*10}L{cm p*13}{cm g}" 1310 PRINT"{space*10}{cm g}{space*10}{cm g}{space*13}{cm g}" 1320 PRINT"{space*4}row 3 L{cm p*10}L{cm p*13}{cm g}" 1330 PRINT:PRINT"the form can be as wide as your printer," 1340 PRINT"{up}less one space. there are 10 printed" 1350 PRINT"spaces per inch of form width, and nine" 1360 PRINT"printer lines per inch of form height. 1370 PRINT:PRINT"you choose an individual width for each" 1380 PRINT"column, and one height for all the rows." 1390 PRINT"you can label the columns and rows. 1400 PRINT:PRINT"forms may be saved to disk. saved forms 1410 PRINT"can be reprinted and/or edited. 1420 PRINT"{down}{light green}{space*5}press any key to continue{.*3}{home}" 1430 GETa$:IFa$=""THEN1430 1440 RETURN 1450 : 1460 REM *** quit 1470 POKE53280,14:PRINT"{light blue}" 1480 LOAD"sta.store",8,1:RUN 1490 : 1500 REM ** form loader 1510 PRINT"{down}{light green}enter the name of an existing form, or 1520 PRINT"press to return to the menu. 1530 PRINTTAB(23);"{down*2}{light gray}{cm t*14}{up*2}" 1540 f$="":INPUT"{white}{space*3}existing form name";f$:f$="f/"+f$:IFf$="f/"THENRUN 1550 OPEN15,8,15:OPEN2,8,2,f$+",s,r" 1560 INPUT#15,a,a$:IFa<20THEN1580 1570 PRINT"{down}{reverse on}{yellow} ";a$;" {down}":CLOSE2:CLOSE15:PRINT"{up*2}":GOTO1530 1580 INPUT#2,lr%,lw,nc%,nr%,pi,pw,tl%:INPUT#2,cl$ 1590 FORj=1TOnc%:INPUT#2,cw%(j):NEXT 1600 FORj=1TOnr%:INPUT#2,rl$(j):NEXT 1610 CLOSE2:CLOSE15 1620 lw$="":FORj=1TOlw:lw$=lw$+" ":NEXT 1630 RETURN 1640 : 1650 REM ** form editor 1660 PRINT"{down}{white}{space*2}your printer width in spaces ";pw;:a=pw:GOSUB2410 1670 INPUTpw:pw=pw-1:IFpw<1THENpw=80:GOTO1660 1680 PRINT"{down}{space*3}your paper length in inches ";pi;:a=pi:GOSUB2410 1690 INPUTpi:pl=INT(9*pi):IFpi<1THENpi=11:GOTO1680 1700 PRINT"{down}{light green}the vertical columns can occupy as many 1710 PRINT"as";pw;"print spaces across the page. 1720 PRINT"there are 10 print spaces per inch.{down} 1730 PRINT"{white}{space*2}how many columns on the form ";nc%;:a=nc%:GOSUB2410 1740 INPUTnc%:IFnc%<1THENPRINTem$:GOTO1730 1750 PRINT:w=0:FORj=1TOnc% 1760 PRINT"{space*3}how many spaces in column";j;cw%(j);:a=cw%(j):GOSUB2410 1770 INPUTa:IFa<1THENPRINTem$:GOTO1760 1780 cw%(j)=a:w=w+cw%(j):NEXT 1790 PRINT"{down}{light green}these columns take up";w;"of the";pw 1800 PRINT"{light green}available spaces on your printer. there" 1810 PRINT"are";pw-w;"spaces available for labeling 1820 PRINT"the horizontal rows. 1830 IFw>pwTHENPRINT"{down}{reverse on}{yellow} too wide! - try again {down}{light green}":GOTO1730 1840 INPUT"{down}{white}{space*9}is this o.k. (y or n){space*2}y{left*3}";a$ 1850 IFLEFT$(a$,1)<>"y"THENPRINT:GOTO1730 1860 PRINT"{down}{light green}now we will set up the horizontal rows," 1870 PRINT"which can fill up to";pl-1;"printer lines." 1880 PRINT"there are 9 printer lines per inch.{down} 1890 PRINT"{white}{space*5}how many rows on the form ";nr%;:a=nr%:GOSUB2410 1900 INPUTnr%:IFnr%<1THENPRINTem$:GOTO1890 1910 PRINT:nw=LEN(STR$(nr%))-1:nw$=LEFT$("{space*5}",nw) 1920 PRINT"how many printer lines per row ";lr%;:a=lr%:GOSUB2410 1930 INPUTlr%:IFlr%<1THENPRINTem$:GOTO1920 1940 tl%=nr%*lr%+1 1950 PRINT"{down}{light green}these rows take up";tl%;"printer lines," 1960 PRINT"including a line for column labels." 1970 PRINT"your paper has";pl;"lines."; 1980 IFtl%>plTHENPRINT:PRINT"{down}{reverse on}{yellow} error! - too long for the paper {light green}{down}":GOTO1890 1990 PRINT"{left}, leaving";pl-tl% 2000 PRINT"lines unprinted." 2010 INPUT"{down}{white}{space*9}is this o.k. (y or n){space*2}y{left*3}";a$ 2020 IFLEFT$(a$,1)<>"y"THENPRINT:GOTO1890 2030 PRINT"{down}{light green}now we will do the optional labels. 2040 PRINT"{down}your form has";nc%;"vertical columns, 2050 PRINT"which you can label if you wish. 2060 INPUT"{down}{white}{space*4}label the columns (y or n){space*2}y{left*3}";a$ 2070 IFLEFT$(a$,1)<>"y"THENcl$=" ":GOTO2200 2080 GOSUB2430:ls=0:FORj=1TOnc% 2090 PRINT"{down}label for column";j;"-";cw%(j);"spaces"; 2100 IFcw%(j)<2THENPRINT"{left} "; 2110 PRINT:PRINT"{down}{space*2}";q$;CHR$(20);q$; 2120 IFcl$=""THENFORk=1TOcw%(j):PRINT" ";:NEXT:GOTO2150 2130 IFLEN(cl$)38THENPRINT"{up}"; 2160 PRINT"{up}";:POKEk1,29:POKEk2,1:INPUTa$ 2170 IFLEN(a$)<>cw%(j)THENPRINT"{down}{reverse on}{yellow} wrong width! - try again {white}":GOTO 2090 2180 l$=l$+a$:NEXT:cl$=l$ 2190 : 2200 INPUT"{down}{white}{space*7}label the rows (y or n){space*2}y{left*3}";a$ 2210 IFLEFT$(a$,1)<>"y"THEN2390:REM this dest ok?? 2220 PRINT"{down}{light green}the form is";w;"spaces wide, leaving" 2230 PRINT"{left}";pw-w;"spaces for labeling its";nr%:PRINT"horizontal rows. 2240 PRINT"{down}{white}{space*2}how many to allow for labels ";lw;:a=lw:GOSUB2410 2250 INPUTlw:IFlw<1THENPRINTem$:GOTO2240:REM maybe not needed 2260 IFlw>pw-wTHENPRINT"{down}{space*7}{reverse on}{yellow} error! -";pw-w;"{left} maximum {white}":GOTO2240 2270 lw$="":FORj=1TOlw:lw$=lw$+" ":NEXT 2280 GOSUB2430 2290 FORj=1TOnr% 2300 rl$=rl$(j)+lw$:PRINT"{down}label for row";j;"-";lw;"spaces"; 2310 IFlw<2THENPRINT"{left} "; 2320 PRINT:PRINT"{down}{space*2}";q$;MID$(rl$,1,lw); 2330 a=POS(0):PRINTq$:IFa>38THENPRINT"{up}"; 2340 PRINT"{up}";:POKEk1,29:POKEk2,1:INPUTrl$ 2350 IFLEN(rl$)<>lwTHENPRINT"{down}{reverse on}{yellow} wrong length!! - try again {white}":GOTO2300 2360 rl$(j)=rl$ 2370 NEXT 2380 PRINT"{down}{light green}your form is finished!" 2390 RETURN 2400 : 2410 PRINTLEFT$("{left*8}",2+LEN(STR$(a)));:RETURN:REM align input 2420 : 2430 PRINT"{down}{light green}enter the labels right now. you must" 2440 PRINT"keep them between the quotation marks," 2450 PRINT"but you can center them or position" 2460 PRINT"them as you like.{white}" 2470 RETURN 2480 : 2490 REM ** form saver 2500 PRINT#2,lr%;r$;lw;r$;nc%;r$;nr%;r$;pi;r$;pw+1;r$;tl% 2510 PRINT#2,q$+cl$+q$ 2520 FORj=1TOnc%:PRINT#2,cw%(j):NEXT 2530 FORj=1TOnr%:PRINT#2,q$+rl$(j)+q$:NEXT 2540 CLOSE2:CLOSE15 2550 RETURN stop tok64 (bastext 1.0)