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

CHILDREN( _tables, _keys )

Purpose

Determine the number of child tables, as marked by relation type = "C"
in the dictionary, and optionally fill an array with their names and
relational keys.

Arguments

     _tables -- if passed, array to fill with table names

     _keys -- if passed, array to fill with relational keys

Setup

Call once to obtain the number of child tables of the current table this
requires the dictionary. Declare arrays of that size, then call a second
time, passing the arrays as parameters to fill them.

Table B is a child of table A if it has a field which is a primary key of
A, and if a relation is set on this key from A to B when A is selected.
Child tables are defined in DICT as relation type "C". Artful functions
assume that a child relation is one-to-many. For example, multi-user
GET_STD2() places file locks on child tables, but record locks on
parent tables.

Example

     LOCAL nKids, aTables, aKeys
     CHK_DICT( "AAI_DICT" )
     SELECT CUSTOMER
     nKids := CHILDREN()

     IF nKids > 0
         CHILDREN( aTables := ARRAY( nKids ), ;
                   nKeys := ARRAY( nKids ) )
         AEVAL( aTables, { | x | QOUT( x ) } )
         AEVAL( aKeys, { | x | QOUT( x ) } )
     ENDIF

Returns

Number of child tables according to the dictionary record of the current
table.

Side Effects

Fills arrays if they are passed.

Artful Calls

DICTFIND, STRINT

Source File

AA_RELAT.PRG

See Also: SET_RELAT() PARENTS()

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