0REM These procedures and functions
1REM are for your own programs.
2REM Note the REMs and *******
3REM which denote the end of a
4REM procedure or function.
5REM Please read the documentation
6REM for further information.
7CLS:PRINT"READ THE DOCUMENTATION FI
RST"'"THEN LIST THIS PROGRAM"
8END
10DEF FNCASE(A$)
20*|"
30*|" Case Conversion
40*|" by John Carpenter
50*|" so there!
60*|"
70LOCAL B$,b%,a$,a%
80FORa%=1 TO LEN(A$)
90B$=MID$(A$,a%,1)
100b%=ASC(B$)
110IFb%<123 AND b%>96 THEN b%=b%-32
120a$=a$+CHR$b%
130NEXTa%
140 =a$
192REM *******
200DEF PROCcheck(z$)
210f%=FALSE
220FORn%=1 TO LEN(Z$)
230 a%=INSTR(Z$,z$)
240IFa%<>0 THEN f%=a%
250NEXTn%
260IF NOT f% check$=MID$(Z$,a%,LEN(z$)
)
270ENDPROC
280REM *******
300DEF PROCcon
310VDU 23,1,1;0;0;0;
320ENDPROC
330DEF PROCcoff
340VDU23,1,0;0;0;0;
350ENDPROC
360REM *******
400DEFPROCesccode:CLS
410PRINT"ESC+A Red ESC+B Gr
een"
420PRINT"ESC+C Yellow ESC+D Bl
ue"
430PRINT"ESC+E Magenta ESC+F Cy
an"
440PRINT"ESC+G White ESC+H Fl
ash"
450PRINT"ESC+I Steady ESC+J Ex
it & Save"
460PRINT"ESC+M Double Height ESC+L Si
ngle Ht."
470PRINT"ESC+O Block ESC+P Pi
xel Editor"
480PRINT"ESC+Q Red ESC+R Gr
een
490PRINT"ESC+S Yellow ESC+T Bl
ue
500PRINT"ESC+U Magenta ESC+V Cy
an
510PRINT"ESC+W White ESC+X "
520PRINT"ESC+Y Con. ESC+Z Se
p.
530PRINT"ESC+^ Hold Graphics ESC+- Re
lease Gpx"
540PRINT"ESC+] New B/Ground ESC+½ Bl
ack BG"
550PRINT" NB Use CAPITAL letters where
stated!"
560PRINT" Also @ can be used instead o
f ESC"
570PRINT" Press Any Key
,,,,,,,,,,";
580G=GET:ENDPROC
590REM ******
600DEFPROCfkeys:OSCLI"KEY 0 "+"¶"
610OSCLI"KEY 2 "+"
630OSCLI"KEY 6 "+" "
640OSCLI"KEY 7 "+" 650ENDPROC
660REM ******
700 DEF FNinput(length%)
710 LOCAL total$,key%
720 REPEAT
730 key% = GET
740 IF key%=13 GOTO 800
750 IF key%=127 AND LEN(total$)=0 THEN
730
760 IF key%=127 VDU8,32,8:total$=L
EFT$(total$,LEN(total$)-1):GOTO730
770 IF LEN(total$)=length% GOTO730
780 total$ = total$ + CHR$(key%)
790 VDU key%
800 UNTIL key%=13
810 =total$
820REM ******
900DEF FNlen(len$,len%)
910IF LEN(len$)>len% THEN =LEFT$(len$,
len%)
920IF LEN(len$)=len% THEN =len$
930REPEAT
940len$=len$+" "
950UNTIL LEN(len$)=len%
960=len$
970REM ******
1000 DEF FNpassword(length%)
1010 LOCAL key%,line$
1020 key%=GET
1030 IF key%=13 THEN =line$
1040 IF key%=127 AND LEN(line$)=0 THE
N 1020
1050 IF key%=127 THEN line$=LEFT$(lin
e$,LEN(line$)-1):VDU8,32,8:GOTO1020
1060 IF LEN(line$)=length% THEN 1020
1070 line$=line$+CHR$key%
1080 VDU 42
1090 GOTO1020
1095REM ******
1100DEF PROCreturn
1110PRINT'" Press Return ";
1120REPEAT UNTILGET=13
1130FORa%=1TO18
1140VDU8
1150NEXTa%
1160PRINT" ";
1170FORA=1TO500:NEXTA
1180ENDPROC
1190REM ******
1200 DEF PROCmoveto(xpos%,ypos%)
1210 IF ?&70=13 AND ypos%=21 VDU30:ENDP
ROC
1220 REPEAT
1230 IF POS>xpos% THEN VDU8
1240 IF POS<xpos% THEN VDU9
1250 IF VPOS<ypos% THEN VDU10
1260 IF VPOS>ypos% THEN VDU11
1270 UNTIL xpos%=POS AND ypos%=VPOS
1280 ENDPROC
1290REM ******
1300 DEF PROCwrite`text(file%,string$)
1310 LOCAL loop%
1320 FOR loop%=1 TO LEN(string$)
1330 BPUT#file%,ASC(MID$(string$,lo
op%,1))
1340 NEXT
1350 BPUT#file%,13
1360 ENDPROC
1370