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 p
rocessor used for changing part of a
display running continuously on a Be
eb-based system in the window of a ch
arity shop.";
350PRINT" The display runs for two m
inutes and then repeats, giving informa
tion about the charity and asking for d
onations of particular items."
360PRINT" All this is fixed in the p
rogram, but one screen- five lines of do
uble-height letters inside a 'moving lig
hts' border - needed to be changed easil
y by anyone";
370PRINT" at any time to display a new
message of the 'Today's Special Offer'
variety."
380PRINTBL2$;
390PRINT" The idea was to try to cre
ate a mini WP that would be easy and fu
n to use."
400PRINT" It was also an experiment in
typing in double-height letters, inclu
ding word wrap (this works surprisingl
y quickly).";
410PRINTBL2$;
420PRINTTAB(27,24)"Press SPACE:";
430G$=GET$:CLS
440IF G$="O" THEN840
450PRINTWP$" Notes 2:"
460PRINTBL2$;
470PRINT" This program is separate f
rom the display program (not on this
disc), and is chained from its menu. Th
e message"
480PRINT" created with this program is
saved as 'MiniMsg', which is then loa
ded by the display program. There is a
sample message on this disc."
490PRINT" The WP ensures that the me
ssage will fit inside the border (which
is in both this program and the display
program)."
500PRINT" Each line is automatically
centred - temporarily - when the messa
ge is displayed, and also when it
is saved."
510PRINTBL2$;
520PRINT" That legendary saying 'QWE
RTY uiop' is included on f9 for genera
ting dummy words quickly."
530PRINTBL2$;
540PRINT" There are two modes of ope
ration - Write and Edit."
550PRINTBL2$;
560PRINTTAB(7)"Press SPACE for Write/E
dit 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 co
ntinuously. Changes are made by delet
ing back - letter by letter or whole
lines."
630PRINT" 4) All letters and symbols o
n the keyboard can be used. Tab
='¶'."
640PRINT" 5) Letters will be lower cas
e at start.";
650PRINT" 6) C O L O U R S can be chan
ged for all lines at once, using Curs
or Up or Down for tops or bottoms
of letters.";
660PRINT" 7) Function key colours, fla
sh, and graphics can be used norm
ally in Write and Edit modes. Fla
sh should be turned off inside the
line."
670PRINT" 8) Colours added inside any
line cancel two-tone mode for the res
t of line."
680PRINTBL2$;
690PRINTTAB(8)"Press SPACE for EDIT Mo
de 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 me
ssage could be written in EDIT mode.
"
740PRINT" 2) There is no word wrap."
750PRINT" 3) All letters typed are ins
erted at the cursor."
760PRINT" 4) Letters or words that dis
appear to the right can be retrieve
d 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 a
t bottom."
800PRINT" 8) Lines can be rearranged i
n any order with crafty use of Swap a
nd cursor."
810PRINTBL2$;
820PRINTTAB(10)"Press SPACE for Option
s 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: W to Write or change
message."
970PRINTTAB(7);CHR$(148);STRING$(31,",
")
980PRINTTAB(7)" L to Load file MiniMsg
."
990PRINTTAB(7)" S to Save message as M
iniMsg. (all lines saved cen
tred)"
1000PRINTTAB(7);CHR$(148);STRING$(31,",
")
1010PRINTTAB(7)" D to Display message i
n border.";
1020PRINTTAB(9)" (ESC to return here)"
1030PRINTTAB(7);CHR$(148);STRING$(31,",
")
1040PRINTTAB(7)" I for Write/Edit Infor
mation."
1050PRINTTAB(7)" R to Re-Run program."
1060PRINTTAB(7)" ESC to quit."
1070PRINTBL$
1080PRINT'BL$
1090G$=GET$
1100IF G$="W" THEN1190
1110IF G$="L" PROCload:GOTO1190
1120IF G$="S" PROCcentre:PROCsave:GOTO1
090
1130IF G$="D" PROCcentre:PROCborder
1140IF G$="I" CLS:VDU23,1,1;0;0;0;:GOTO
580
1150IF G$="R" RUN
1160IF G$="÷" FILE$="AltMsg":PROCload:F
ILE$="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)" CU
RSORS Up/Dn select colours."TAB(39,18);C
HR$(156)
1340PRINTTAB(1,19)" Press: DELETE to re
move last letter. RETURN to mo
ve down one line."
1350PRINTTAB(8,21)" f0 to delete line /
message."
1360PRINTTAB(8,22)" f9 for dummy words.
"
1370PRINTTAB(8,23)" "CHR$(157)" COPY fo
r EDIT Mode. "CHR$(156)
1380PRINTTAB(8,24)" "CHR$(157)" ESCAPE
for 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:GOTO148
0
1640IF A%=179 FC%=1:PROCcolours:GOTO148
0
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):P
ROClast: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 LI
NE "
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)" f5 to CANCEL Edit c
hanges. "
2490PRINTTAB(8,19)" CURSORS select line
/ position."
2500PRINTTAB(8,20)" DELETE to remove le
tters. "
2510PRINTTAB(8,21)" f0/1: delete line/f
rom cursor."
2520PRINTTAB(8,22)" RETURN to swap line
s - down."
2530PRINTTAB(8,23)" "CHR$(157)" COPY fo
r WRITE Mode. "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$(1
52);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%<LEN(X2$(Y%)
)+2):GOTO2650
2780IF A%=178 FORN%=1TO5:K$(N%)=X2$(N%)
:NEXT:ENDPROC
2790IF A%=179 PRINTTAB(37,Y%*3)" ";TAB(
1,Y%*3+2);CHR$(152):Y%=(Y%)MOD5+1:GOTO26
20
2800IF A%=180 PRINTTAB(37,Y%*3)" ";TAB(
1,Y%*3+2);CHR$(152):Y%=5-(6-Y%)MOD5:GOTO
2620
2810IF A%=127 AND X%>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%)="":PRIN
TTAB(2,Y%*3);SPC(33);TAB(2,Y%*3+1);SPC(3
3):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%<LEN(X2$(Y%))+3)
2910X2$(Y%)=LEFT$(X$(Y%),33)
2920PRINTTAB(2,Y%*3);X2$(Y%)" "
2930PRINTTAB(2,Y%*3+1);X2$(Y%)" "
2940GOTO2650
2950" **
2960DEFPROCdelright
2970X$(Y%)=LEFT$(X$(Y%),X%-2)
2980X2$(Y%)=X$(Y%)
2990PRINTTAB(X%,Y%*3);SPC(35-X%)
3000PRINTTAB(X%,Y%*3+1);SPC(35-X%)
3010ENDPROC
3020" **
3030DEFPROCswap
3040Y2%=(Y%)MOD5+1
3050S$=X$(Y%):S2$=X2$(Y%)
3060IF Y%<5 THEN3120
3070 FORN%=4TO1 STEP-1
3080 X$(N%+1)=X$(N%)
3090 X2$(N%+1)=X2$(N%)
3100 NEXT
3110 GOTO3130
3120X$(Y%)=X$(Y2%):X2$(Y%)=X2$(Y2%)
3130X$(Y2%)=S$:X2$(Y2%)=S2$
3140FORN%=1TO5
3150PRINTTAB(2,N%*3);X2$(N%);SPC(33-LEN
(X2$(N%)))
3160PRINTTAB(2,N%*3+1);X2$(N%);SPC(33-L
EN(X2$(N%)))
3170NEXT
3180PRINTTAB(37,Y%*3)" "
3190PRINTTAB(1,Y%*3+2);CHR$(152)
3200Y%=(Y%)MOD5+1
3210ENDPROC
3220" **
3230DEFPROCcancel
3240FORN%=1TO5
3250X$(N%)=K$(N%):X2$(N%)=K$(N%)
3260NEXT
3270FORN%=1TO5
3280PRINTTAB(2,N%*3);SPC(33)
3290PRINTTAB(2,N%*3+1);SPC(33)
3300PRINTTAB(2,N%*3);K$(N%)
3310PRINTTAB(2,N%*3+1);K$(N%)
3320NEXT
3330PRINTTAB(37,Y%*3)" ";TAB(1,Y%*3+2);
CHR$(152)
3340Y%=1
3350ENDPROC
3360" **
3370DEFPROCsetborder
3380FORN%=1TO36
3390FORM%=1TO4
3400READX
3410B%(N%,M%)=X
3420NEXT:NEXT
3430DATA1,2,1,3,4,2,4,3,7,2,7,3,10,2,10
,3,13,2,13,3,16,2,16,3,19,2,19,3
3440 DATA22,2,22,3,25,2,25,3,28,2,28,3,
31,2,31,3,34,2,34,3,37,2,37,3
3450 DATA37,5,37,6,37,8,37,9,37,11,37,1
2,37,14,37,15,37,17,37,18
3460 DATA37,20,37,21,34,20,34,21,31,20,
31,21,28,20,28,21,25,20,25,21,22,20,22,2
1
3470 DATA19,20,19,21,16,20,16,21,13,20,
13,21,10,20,10,21,7,20,7,21,4,20,4,21,1,
20,1,21
3480 DATA1,17,1,18,1,14,1,15,1,11,1,12,
1,8,1,9,1,5,1,6
3490H$=CHR$(141)+" ¶"+STRING$(12," ¶")
3500ENDPROC
3510" **
3520DEFPROCcentre
3530FORN%=1TO5:M$(N%)=K$(N%):NEXT
3540FORN%=1TO5
3550IF M$(N%)="" THEN3590
3560IF LEFT$(M$(N%),1)=" " M$(N%)=RIGHT
$(M$(N%),LEN(M$(N%))-1):GOTO3560
3570IF RIGHT$(M$(N%),1)=" " M$(N%)=LEFT
$(M$(N%),LEN(M$(N%))-1):GOTO3570
3580IF (RIGHT$(M$(N%),1)="." OR RIGHT$(
M$(N%),1)=",") AND LEN(M$(N%))<33 M$(N%)
=" "+M$(N%)
3590NEXT
3600FORN%=1TO5
3610IF M$(N%)="" THEN3630
3620M$(N%)=STRING$((33-LEN(M$(N%)))/2,"
")+M$(N%)
3630NEXT
3640ENDPROC
3650" **
3660DEFPROCborder
3670ONERRORCLS:GOTO840
3680CLS
3690PRINT'
3700PRINTH$:PRINTH$
3710FORN%=5TO17 STEP3
3720PRINTTAB(0,N%);CHR$(141)" ¶"CHR$(CT
%);TAB(37,N%)" ¶"
3730PRINTTAB(0,N%+1);CHR$(141)" ¶"CHR$(
CB%);TAB(37,N%+1)" ¶"
3740NEXT
3750PRINTTAB(0,20);H$
3760PRINTTAB(0,21);H$
3770FORN%=1TO5
3780PRINTTAB(4,N%*3+2);M$(N%)
3790PRINTTAB(4,N%*3+3);M$(N%)
3800NEXT
3810FORN%=0TO3
3820FORM%=1TO33 STEP4
3830X%=(M%+N%)MOD36+1
3840PRINTTAB(B%(X%,1),B%(X%,2))" "
3850PRINTTAB(B%(X%,3),B%(X%,4))" "
3860NEXT
3870FORD=1TO5:NEXT
3880FORM%=1TO33 STEP4
3890PRINTTAB(B%(M%+N%,1),B%(M%+N%,2))"
"
3900PRINTTAB(B%(M%+N%,3),B%(M%+N%,4))"
"
3910NEXT:NEXT
3920GOTO3810