not tested, but looks about right.

code:
$file="c:\temp.txt"
$string="whatever"
$length=len($string)

$count=0

$=open(1,$file,1)
$line=readline(1)
while @error=0
:lookagain
$pos=instrrev($line,$string)
if $pos
$count=$count+1
$string=left($string,$pos)
goto lookagain
endif
$line=readline(1)
loop
$=close(1)
? $count

_________________________
How to ask questions the smart way <-----------> Before you ask