10REM"Mini WP 20REM J.Davis -'96. 30MODE7 40ONERRORGOTO880 50*ACCESS MiniMsg 60*FX202,32 70*FX4,2 80DIMK$(5):DIMM$(5):DIMB%(36,4) 90DIMX$(5):DIMX2$(5) 100PROCsetborder 110L%=1 120CT%=134:CB%=130 130C0%=5:C1%=1 140FC%=0:REM col. 150FILE$="MiniMsg" 160*K.0 POS 170*K.9QWERTY uiop 180*K.11 RAD 190*K.14 RND 200*K.15 SGN 210REM K.0,11,14,15 = 1,2,3,4 - ASC177-180 220*K.1 MID$( 230*K.5 RIGHT$( 240*K.12 STR$ 250*K.13 STRING$( 260REM K.1,5,12,13 = A,B,C,D - ASC193-196 270FORN%=1TO5:K$(N%)="":NEXT 280WP$=""+CHR$(157)+"* M i n i W P * "+CHR$(156) 290BL$=CHR$(148)+STRING$(38,",") 300BL2$=CHR$(148)+STRING$(39,",") 310VDU23,1,1;0;0;0; 320PRINTWP$" Notes 1:" 330PRINTBL2$; 340PRINT" This is a miniature word processor used for changing part of a display running continuously on a Beeb-based system in the window of a charity shop."; 350PRINT" The display runs for two minutes and then repeats, giving information about the charity and asking for donations of particular items." 360PRINT" All this is fixed in the program, butone screen- five lines of double-heightletters inside a 'moving lights' border- needed to be changed easily by anyone"; 370PRINT"at any time to display a new message ofthe 'Today's Special Offer' variety." 380PRINTBL2$; 390PRINT" The idea was to try to create a mini WP that would be easy and fun to use." 400PRINT"It was also an experiment in typing in double-height letters, including word wrap (this works surprisingly quickly)."; 410PRINTBL2$; 420PRINTTAB(27,24)"Press SPACE:"; 430G$=GET$:CLS 440IF G$="O" THEN840 450PRINTWP$" Notes 2:" 460PRINTBL2$; 470PRINT" This program is separate from the display program (not on this disc), andis chained from its menu. The message" 480PRINT"created with this program is saved as 'MiniMsg', which is then loaded by the display program. There is a sample message on this disc." 490PRINT" The WP ensures that the message will fit inside the border (which is in boththis program and the display program)." 500PRINT" Each line is automatically centred - temporarily - when the message is displayed, and also when it is saved." 510PRINTBL2$; 520PRINT" That legendary saying'QWERTY uiop' is included on f9 for generating dummy words quickly." 530PRINTBL2$; 540PRINT" There are two modes of operation - WriteandEdit." 550PRINTBL2$; 560PRINTTAB(7)"Press SPACE for Write/Edit info:"; 570G=GET:CLS 580PRINTWP$:PRINTBL2$; 590PRINT""CHR$(157)"Information 1:"CHR$(156)" WRITE Mode:" 600PRINT'"1)Maximum line length: 33 characters." 610PRINT"2)Words wrap at end of each line." 620PRINT"3)The message is entered continuously. Changes are made by deleting back - letter by letter or whole lines." 630PRINT"4)All letters and symbols on the keyboard can be used. Tab=''." 640PRINT"5)Letters will be lower case at start."; 650PRINT"6)COLOURScan be changed for all lines at once, using Cursor Up or Down for tops or bottoms of letters."; 660PRINT"7)Function key colours, flash, and graphics can be used normally in Write and Edit modes. Flash should be turned off inside the line." 670PRINT"8)Colours added inside any line cancel two-tone mode for the rest of line." 680PRINTBL2$; 690PRINTTAB(8)"Press SPACE for EDIT Mode info:"; 700G=GET:CLS 710PRINTWP$:PRINTBL2$; 720PRINT""CHR$(157)"Information 2:"CHR$(156)" EDIT Mode:" 730PRINT'"1)Each line is changed or written separately. The whole message could be written in EDIT mode." 740PRINT"2)There is no word wrap." 750PRINT"3)All letters typed are inserted at the cursor." 760PRINT"4)Letters or words that disappear to the right can be retrieved at any time using Delete." 770PRINT"5)Delete removes the letter to the left of the cursor in all positions except in column 1, where it removes the letter at the cursor." 780PRINT"6)The red bar cursor wraps at top and bottom." 790PRINT"7)The Swap function wraps at bottom." 800PRINT"8)Lines can be rearranged in any order with crafty use of Swap and cursor." 810PRINTBL2$; 820PRINTTAB(10)"Press SPACE for Options menu:"; 830G=GET:CLS 840VDU23,1,0;0;0;0; 850ONERRORGOTO880 860GOTO940 870 REM ERR ROUTINE 880 *FX4,0 890 VDU23,1,1;0;0;0; 900 CLS:PRINTWP$:PRINTBL$:PRINT 910 IF ERR=17 END 920 VDU7:REPORT 930 PRINT':END 940PRINTWP$:PRINTBL$ 950PRINT""CHR$(157)"Options: "CHR$(156) 960PRINT'" PRESS:Wto Write or change message." 970PRINTTAB(7);CHR$(148);STRING$(31,",") 980PRINTTAB(7)"Lto Load file MiniMsg." 990PRINTTAB(7)"Sto Save message as MiniMsg. (all lines saved centred)" 1000PRINTTAB(7);CHR$(148);STRING$(31,",") 1010PRINTTAB(7)"Dto Display message in border."; 1020PRINTTAB(9)"(ESC to return here)" 1030PRINTTAB(7);CHR$(148);STRING$(31,",") 1040PRINTTAB(7)"Ifor Write/Edit Information." 1050PRINTTAB(7)"Rto Re-Run program." 1060PRINTTAB(7)"ESCto quit." 1070PRINTBL$ 1080PRINT'BL$ 1090G$=GET$ 1100IF G$="W" THEN1190 1110IF G$="L" PROCload:GOTO1190 1120IF G$="S" PROCcentre:PROCsave:GOTO1090 1130IF G$="D" PROCcentre:PROCborder 1140IF G$="I" CLS:VDU23,1,1;0;0;0;:GOTO580 1150IF G$="R" RUN 1160IF G$="~" FILE$="AltMsg":PROCload:FILE$="MiniMsg":GOTO1190 1170IF G$="|" FILE$="AltMsg":PROCcentre:PROCsave:FILE$="MiniMsg":GOTO1090 1180GOTO1090 1190CLS 1200*FX202,48 1210ONERRORGOTO1240 1220GOTO1260 1230 REM ERR ROUTINE 1240 CLS:*FX202,32 1250 GOTO840 1260PRINTWP$"WRITE Mode | 33" 1270PRINTTAB(0,1)""STRING$(37,"") 1280PRINTTAB(0,2)"" 1290FORN=1TO5 1300PRINTTAB(0,N*3);CHR$(141);CHR$(CT%);TAB(36);CHR$(140)""N 1310PRINTTAB(0,N*3+1);CHR$(141);CHR$(CB%);TAB(37)"" 1320NEXT 1330PRINTTAB(1,18)""CHR$(157)" CURSORS Up/Dnselect colours."TAB(39,18);CHR$(156) 1340PRINTTAB(1,19)"Press:DELETEto remove last letter. RETURNto move down one line." 1350PRINTTAB(8,21)"f0to delete line / message." 1360PRINTTAB(8,22)"f9for dummy words." 1370PRINTTAB(8,23)""CHR$(157)"COPYforEDITMode. "CHR$(156) 1380PRINTTAB(8,24)""CHR$(157)"ESCAPEfor Options menu. "CHR$(156); 1390N%=1 1400FORM%=1TO5 1410IF K$(M%)="" THEN1450 1420 PRINTTAB(2,M%*3);K$(M%) 1430 PRINTTAB(2,M%*3+1);K$(M%); 1440 N%=M% 1450NEXT 1460GOTO1710 1470REM"WRITE Routine 1480VDU23,1,1;0;0;0; 1490G$=GET$ 1500A%=ASC(G$) 1510VDU23,1,0;0;0;0; 1520IF A%>192 THEN1480 1530IF A%=177 K$(N%)="":PRINTTAB(2,N%*3);SPC(33):PRINTTAB(2,N%*3+1);SPC(33):N%=N%-1:GOTO1700 1540IF A%=178 PROCedit:GOTO1190 1550IF A%<>127 GOTO1590 1560 IF K$(N%)="" N%=N%-1:GOTO1700 1570 K$(N%)=LEFT$(K$(N%),LEN(K$(N%))-1) 1580 GOTO1700 1590IF A%<>13 GOTO1630 1600 N%=N%+1 1610 IF N%=6 N%=5:PROClast:GOTO1770 1620 GOTO1710 1630IF A%=180 FC%=0:PROCcolours:GOTO1480 1640IF A%=179 FC%=1:PROCcolours:GOTO1480 1650IF A%=9 G$="" 1660K$(N%)=K$(N%)+G$ 1670IF LEN(K$(N%))<34 GOTO1700 1680 IF N%=5 K$(N%)=LEFT$(K$(N%),33):PROClast:GOTO1770 1690 PROCwrap 1700IF N%=0 N%=1 1710PRINTTAB(L%,1)"" 1720PRINTTAB(L%+1,2)" " 1730L%=LEN(K$(N%))+1 1740PRINTTAB(L%+(1ANDL%<10),1);L% 1750PRINTTAB(L%+1,2)"|" 1760PRINTTAB(2,N%*3);K$(N%)" " 1770PRINTTAB(2,N%*3+1);K$(N%)" ";:VDU8 1780GOTO1480 1790"** 1800DEFPROClast 1810VDU7 1820PRINTTAB(8,17)"THIS IS THE LAST LINE " 1830FORD=1TO3000:NEXT 1840PRINTTAB(8,17);SPC(23) 1850ENDPROC 1860"** 1870DEFPROCwrap 1880PRINTTAB(L%,1)"";TAB(L%+1,2)" " 1890L%=35:K%=0 1900IF RIGHT$(K$(N%),1)=" " K$(N%)=LEFT$(K$(N%),33):GOTO1970 1910REPEAT 1920L%=L%-1 1930UNTILMID$(K$(N%),L%,1)=" " OR L%=0 1940IF L%=0 L%=34:K%=1 1950K$(N%+1)=RIGHT$(K$(N%),34-L%+K%) 1960K$(N%)=LEFT$(K$(N%),L%-1) 1970PRINTTAB(2,N%*3);K$(N%);SPC(35-L%) 1980PRINTTAB(2,N%*3+1);K$(N%);SPC(35-L%) 1990N%=N%+1 2000ENDPROC 2010"** 2020DEFPROCcolours 2030IF FC%=1 THEN2100 2040C0%=(C0%+1)MOD7 2050CT%=129+C0% 2060FORJ%=3TO15 STEP3 2070PRINTTAB(1,J%);CHR$(CT%) 2080NEXT 2090GOTO2150 2100C1%=(C1%+1)MOD7 2110CB%=129+C1% 2120FORJ%=3TO15 STEP3 2130PRINTTAB(1,J%+1);CHR$(CB%) 2140NEXT 2150PRINTTAB(2,N%*3+1);K$(N%)" ";:VDU8 2160ENDPROC 2170"** 2180DEFPROCsave 2190PRINTTAB(1,17)"Saving..." 2200Z=OPENOUT FILE$ 2210FORN%=1TO5 2220PRINT#Z,M$(N%) 2230NEXT 2240PRINT#Z,CT%,CB% 2250CLOSE#Z 2260PRINTTAB(1,17)" " 2270ENDPROC 2280"** 2290DEFPROCload 2300PRINTTAB(1,17)"Loading..." 2310Z=OPENIN FILE$ 2320FORN%=1TO5 2330INPUT#Z,K$(N%) 2340NEXT 2350INPUT#Z,CT%,CB% 2360CLOSE#Z 2370PRINTTAB(1,17)" " 2380ENDPROC 2390"** 2400DEFPROCedit 2410ONERRORGOTO2440 2420GOTO2470 2430 REM ERR ROUTINE 2440 FORN%=1TO5:K$(N%)=X2$(N%):NEXT 2450 CLS:*FX202,32 2460 GOTO840 2470PRINTTAB(22,0)"EDIT Mode " 2480PRINTTAB(8,18)"f5toCANCELEditchanges. " 2490PRINTTAB(8,19)"CURSORSselect line / position." 2500PRINTTAB(8,20)"DELETEto remove letters. " 2510PRINTTAB(8,21)"f0/1:delete line/from cursor." 2520PRINTTAB(8,22)"RETURNto swap lines - down." 2530PRINTTAB(8,23)""CHR$(157)"COPYforWRITEMode. "CHR$(156) 2540VDU23,1,0;0;0;0; 2550Y%=1 2560FORN%=1TO5 2570X$(N%)=K$(N%) 2580X2$(N%)=K$(N%) 2590PRINTTAB(0,N%*3+2);CHR$(145);CHR$(152);STRING$(33,","):REM CONCEAL 2600NEXT 2610X2%=L%+1 2620X%=2 2630PRINTTAB(37,Y%*3)"" 2640PRINTTAB(1,Y%*3+2)" ":REM REVEAL 2650PRINTTAB(X2%-1,1)"" 2660PRINTTAB(X2%,2)" " 2670PRINTTAB(X%-(1ANDX%>10),1);X%-1 2680PRINTTAB(X%,2)"|" 2690PRINTTAB(X%,Y%*3+1); 2700X2%=X% 2710REM"EDIT 2720VDU23,1,1;0;0;0; 2730G$=GET$ 2740A%=ASC(G$) 2750VDU23,1,0;0;0;0; 2760IF A%=195 X%=X%-(1ANDX%>2):GOTO2650 2770IF A%=196 X%=X%+(1ANDX%2 X$(Y%)=LEFT$(X$(Y%),X%-3)+RIGHT$(X$(Y%),LEN(X$(Y%))-X%+2):X%=X%-1:GOTO2910 2820IF A%=127 AND X%=2 X$(Y%)=RIGHT$(X$(Y%),LEN(X$(Y%))-1):GOTO2910 2830IF A%=177 X$(Y%)="":X2$(Y%)="":PRINTTAB(2,Y%*3);SPC(33);TAB(2,Y%*3+1);SPC(33):X%=2:GOTO2930 2840IF A%=193 PROCdelright:GOTO2930 2850IF A%=13 PROCswap:GOTO2620 2860IF A%=9 G$="" 2870IF A%=194 PROCcancel:GOTO2620 2880IF X%=35 VDU7:GOTO2650 2890X$(Y%)=LEFT$(X$(Y%),X%-2)+G$+RIGHT$(X$(Y%),LEN(X$(Y%))-X%+2) 2900X%=X%+(1ANDX%