Aurel,
try this.
sys dpos[1000]
Sub Tally (String Main,String Match)
sys i,j,q,mlen,matchlen, string t
mlen = LEN(Main)
matchlen = LEN(Match)
i=1: j=0: q=0
iF matchlen=0 or mlen=0 Then Return
WHILE (1)
t=MID(Main,i,matchlen)
IF t = CHR(39) THEN q = q+1
IF q=2 THEN q=0
IF t = Match AND q=0
inc j
dpos[j]=i
END IF
inc i
IF i> mlen
Exit While
End iF
WEND
Return j
End Sub
sys c, string sc="hello,,,banana,,,and,,,apple,,,man,,,at,,,home,,,,,,go outside,,,,,,"
c= Tally sc,","
print c