Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Artful Two for Clipper 5.0 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

Syntax

KCOUNT( cChild[, xcCond[, pRel_key ]] )

Purpose

Count the child records matching a condition.

Arguments

     cChild -- name of child table

     xcCond -- if passed, the condition to impose on the child table;
                   defaults to entire file

     pRel_key -- if passed, the key value used to lookup into the child
                     table

Setup

Parent and child tables must be open and indexed, ready for use. If
passed, cCond must evaluate to a valid logical expression when
macro-expanded. If a SET RELATION has been established between the parent
and child tables, pRel_key is not needed. If not, the key index must
be active in the child table and pRel_key should contain the key value
to lookup into the child table.

Example

     USE ORDERS INDEX ORDERS2     && Account_No index
     USE CUSTOMER NEW

     DO WHILE !EOF()
         ? TRIM( Last_Name ) + " was shipped " + ;
           STRINT( KCOUNT( "ORDERS", ;
                   "!EMPTY( Ship_Date )", ;
                   Account_No ) ) +  " orders."
         SKIP
     ENDDO

Returns

The number of matches.

Side Effects

Crash on bad parameters.

Artful Calls

MACRO

Source File

AA_KCOUN.PRG

Notes

Useful in report or label runs, and in situations where the SET RELATION
alone does not yield the desired results.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson