Subject Re: [IBO] Get . from OrderingItems
Author Helen Borrie
At 02:33 PM 13/01/2005 +0000, you wrote:

>I have a routine that allows the user to select the ordering of a
>query by clicking on the column header in an TIB_Grid fed by a
>TIB_Query, and then select various modifiers so I can change the
>SQLWhere in the query.
>I'd like to get the qualified <tablename>.<fieldname> of the current
>ordering so I can properly configure the where string into something
>like Query.SQLWhere = 'Where <tablename>.<fieldname> starting with
>(or like or containing) '?''
>I know I can get the OrderingItemNo, but I'm not sure how to
>get "PURCHASEORDER.PONUM" from the OrderingItems when the
>OrderingItemNo = 2.
>The orderingitems is like this:

Well, OrderingItems is a stringlist so you could parse the strings, I guess.

It would be better to write a routine that gets back to the RelationNames
property of the Row object via the (unique) fieldnames of the Fields[]
array (which is also a Row object). The indexes of ARow.RelationNames[]
will correspond with the indexes of Fields[]. The OrderingField property
gives you a reference to the TIB_Column. OrderingItemNo tells you which
OrderingItem is current. OrderingLinks tells you which tablename.fieldname
maps to which OrderingItem (and don't forget that OrderingItems number from
1, not zero).