/usr/share/doc/basic256/examples/testing/instrtest.kbs is in basic256 0.9.6.69a-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # instrtest.kbs 2011-01-05 j.m.reneau
# for 0.9.6.56 and later
a$ = "Now is the time for all good men to come to the Aid of Their party."
print "location of men = " + instr(a$,"men")
print "location of aid = " + instr(a$,"aid")
print "location of aid (ignore case) = " + instr(a$,"aid",1,true)
#
print "locations of all spaces"
l = instr(a$," ")
while l <> 0
print l + " ";
l = instr(a$," ",l+1)
end while
print
#
print "print words"
oldl = 1
l = instr(a$," ")
k = 0
while l <> 0
k = k + 1
print k + " '" + mid(a$,oldl, l-oldl) + "'"
oldl = l + 1
l = instr(a$," ",l+1)
end while
k = k + 1
print k + " '" + mid(a$,oldl, 99999) + "'"
#
print "location of regex [Aa]id = " + instrx(a$,"[Aa]id")
print "location of regex [Hh][Ee] starting at 50 = " + instrx(a$,"[Hh][Ee]",50)
|