Determining Number of records

Chris Sharman chris.sharman@ccagroup.co.uk
Thu, 16 Dec 2004 11:05:06 +0000


Jody Burgess wrote:

> Hi;
>   In QDesign, in an internal or designer procedure, I was wondering how I
> can determine the number of records that would be returned after issueing a
> file statement such as:
> 
> 	file user_info detail close

Bob's suggested one way to do it 'pre-find'.
If you're happy with the number fetched, you can do it post-find without 
  the extra read loop.

Use occurs to say how many records you want on screen, and cache to 
define how many you want read in (limit 255).

You can then use:

let kount = 0
for user_info
  begin
  if newrecord of user_info
   then break
  let kount = kount + 1
  end

This will tell you how many you've got in cache, which is the same as 
how many there are, unless cache is too small.

Chris

PS. I seem to be routinely getting messages out of order - answers 
before questions - are others seeing that, or is it just me ?



-----------------------------------------------------------------------

Any views expressed in this message are those of the sender and not
necessarily those of CCA Group.  The unauthorized use, disclosure,
copying or alteration of this message is forbidden.  The contents of
this message may be confidential and/or privileged, copyright CCA Group
and are intended solely for the use of the individual or entity to whom
they are addressed.  Whilst this message has been scanned, CCA Group
cannot guarantee that it is virus free or compatible with your systems
and accepts no responsibility for any loss or damage arising from its
use. The recipient is advised to run their own anti-virus software. If
you receive this message in error please contact
postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
from your computer systems.