home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1993 May
/
1993-05.d64
/
utildemo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
60 lines
10 rem utility/demo
20 rem by eric j. bryant
30 rem copyright 1993 - compute publications - all rights reserved
32 if a=0 then a=1:load"utilityplus2.ml",8,1
40 rem dimensioning arrays
90 dim t%(100)
100 dim ir%(254)
110 dim s$(254)
120 rem
130 rem building arrays
140 rem
150 for x=1to100: t%(x)=100-x :next
160 for x=1to254: ir%(x)=x :next
170 for x=1to254:s$(x)="trash":next
180 rem
190 for x=1to20 :ix$=mid$(str$(x),2)
200 y=int(rnd(0)*254):if s$(y)<>"trash" then 200
210 s$(y)="treasure-"+ix$:next x
220 rem
230 rem demo
240 rem integer arrays
250 rem
260 printchr$(147);chr$(18);"integer array demo:"
270 for x=1to10:y=int(rnd(0)*254):nu$=mid$(str$(y),2)
280 printspc(1);nu$;tab(5);"(t%) ";
290 sys 52732,t%,y,0:if peek(251)=255 then print"not found":goto 310
300 print"location";peek(251)
310 printtab(5);"(ir%) ";
320 sys 52732,ir%,y,0
330 print"location";peek(251) :next x:gosub590
340 rem
350 rem string arrays
360 rem
370 printchr$(147);chr$(18);"string array demo:"
380 print" the text ";chr$(34);"treasure-(x)";chr$(34);" is located:":poke252,0
390 for x=1to20:ix$=mid$(str$(x),2):a$="treasure"
400 sys 52965,s$,peek(252)
410 vu$=mid$(str$(peek(252)),2):ln=len(vu$): ze$="000"
420 if ln<3 then vu$=left$(ze$,3-ln)+vu$
430 print" ";vu$;:li$=li$+vu$+" ":next x:gosub 590
440 rem
450 rem word wrapper
460 rem
470 printchr$(147);chr$(18);chr$(14);"[215][207][210][196] [215][210][193][208][208][197][210] [196][197][205][207]:";chr$(146);" ";
480 a$="[212]his is a demo for the [215]ord [215]rapping [213]tility! [211]ee how the words were "
490 a$=a$+"automatically wrapped around the heading? [215]ord [215]rapper keeps track "
500 a$=a$+"of what position on screen you enabled this utility, allowing for "
510 a$=a$+"much versitility."
520 sys 52376,1:print:print
530 a$="[193]lso notice how [215]ord [215]rapper just prompted you to press [[210][197][212][213][210][206]], "
540 a$=a$+"this allows you to prompt the user before continuing with a rather "
550 a$=a$+"lengthy text."
560 sys 52376:print:print:gosub 590:
570 printchr$(147);chr$(142);"utility/demo complete."
580 end
590 printchr$(18);"continue?":printchr$(18);"(y)es or (n)o"
600 get a$ :if a$="" then 600
610 if a$<>"n" then return
620 end