function getword(s as string, b as sys) as string
'================================================
'b=1
sys a,c,d,bb,bc
a=0
bb=b
do
c=asc s,b
if c=0 then exit do
if c>32 then exit do
b+=1
end do
bc=b
if c=34 or c=96 then 'quotes
do
b+=1
d=asc s,b
if d=0 or d=c then b+=1 : jmp fwd done
end do
end if
do
c=asc s,b
select c
case 0 to 32 : exit do
case 33 to 47
if c=35 then jmp fwd more '#
if b=bc then b+=1
exit do
case 48 to 57 : jmp fwd more 'numbers
case 58 to 64
if b=bc then b+=1
exit do
case 65 to 90 : jmp fwd more 'capitals
case 91 to 96
if c=95 then jmp fwd more 'underscore
if b=bc then b+=1
exit do
case 97 to 122 : jmp fwd more 'lower case
case 123 to 127
if b=bc then b+=1
exit do
end select
'
'higher ascii chars treated as part of word
'
more:
'
b+=1
end do
'
done:
'
if b>bb then return mid s,bb,b-bb
end function
'TEST
sys i=1
string wd,pr
do
wd=getword("abc(d[xx]+7/6,`qwerty`)",i)
if not wd then exit do
pr+=wd+chr(13,10)
end do
print pr