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