>>>Is there any way to count records in a buffered (mode 5) view without moving the record pointer?
>>
>>Check new WITH (buffering) option of Select-SQL. I'm not sure how does it work internally and it is a slow option, be aware.
>
>Thanks! These record sets are small so speed is not an issue.
You may also
select 0
use (dbf("myalias")) again alias (sys(2015))
count to x
use
Not sure it would exactly work - i.e. it will work, but I'm not sure it will share the buffers (and give the right count), but if it does, it costs almost nothing in resources, and it has its own order (in case indexes exist) and record pointer. If there's a filter, you may need to reapply it, because filter applies to alias.
Didn't try this approach for a while - from the last time I did, I remember that changes to one alias were reflected in the other immediately, but can't be sure whether any buffering was involved then.