>So you have an idea to get the number of records within a filtered cursor? Fast simple and so on?
>
>My customer asks all the time, and I just ignore it ...
>
>
>Thank you for Help
>
>Lutz
Off the top of my head:
local lcFor, lnRecno, lcFilter, lcOrder, lcWhere
select yourtable
lnRecno=recno()
lcFilter=filter()
if !empty(m.lcFilter)
lcWhere=m.lcFilter
endif
lcOrder=order()
if !empty(m.lcOrder)
lcFor=for(tagno(m.lcOrder))
endif
if !empty(m.lcFor)
lcWhere=m.lcWhere+iif(!empty(m.lcWhere)," and ","")+m.lcFor
endif
if !empty(m.lcWhere)
count for &lcWhere to thisform.NumberOfRecords
else
if set('deleted')="ON"
count to thisform.NumberOfRecords
else
thisform.NumberOfRecords=reccount()
endif
endif
If it's not broken, fix it until it is.
My Blog