Default sort order

Ed Kleban Ed at Kleban.com
Sat Dec 10 20:45:05 CST 2005


 
On 12/10/05 7:26 PM, "Ed Kleban" <Ed at Kleban.com> wrote:
 
>  
> Ok, then how about this:   If I have a M:M binary link (I think I've finally
> found a use for one) and I execute:
> 
>     FindLinked( inRecId, inTableA, inTableB )
> 
> Then is there a guaranteed order for the members of the resulting VArraySet?
> 
> Do occur in  inTabeA.recId order?   Or in  inTableB.recID order?
> 
> If the relationship is recursive:
> 
>     FindLinked( inRecId, inTableA, inTableA, inRecursionDirection )
> 
> what will the order be in this case?  Is it dependent up on the value of
> inRecursionDirection?
> 

Hmm, let me present you with a practical example for what I am trying to
accomplish:

I have a table named TItems containing 9 items named (with a string field)
in recId order: I1, I2, I3, ... I8, I9.

There is a recursive M:M parent/child relationship on this table that I
would like to represent using a Binary Link.  Specifically, here are a
couple of the family relationships:

    I1 is parent of children:  ( I4, I5, I6 )
    I2 is parent of children:  ( I6, I4, I7 )

But the order of the children is important and must be preserved!

So I enter the following links:
    LinkRecords( { 1, 4 } )
    LinkRecords( { 1, 5 } )
    LinkRecords( { 1, 6 } )
    LinkRecords( { 2, 6 } )
    LinkRecords( { 2, 4 } )
    LinkRecords( { 2, 7 } )

Now then, Is there a call I can make that will return me an ArraySet with
the children of I2 necessarily in the order that these relationships were
defined?

How about:

    anArraySet = aVLink.FindLinked( 2, TItems, Titems, kFromParentToChild )

Will this necessarily return anArraySet = { 6, 4, 7 }?

Or can I not assume the order of the elements in the returned anArraySet ?



 




More information about the Valentina mailing list