1. In case I have to count records in a report that is working with the bFor data, how can I do it ?
local nCounter := 1
COLUMN DATA nCounter HEADER "Number" PICTURE '999'
FOR cond -> { || If( <yourforcond>, ( nCounter++, .t. ), .f. ) }
2. hen I have to build filters at runtime, what's the best way to do it ?
You are anyway constructing a for condition using field names of the DBF. Please set the same string as SET FILTER TO &focond
Whether the filter is fully optimized for speed or not depends on whether you have indexes built on the fields used in the condition.