Subject | Re: [IBO] Index of OrderingColumn |
---|---|
Author | Luiz |
Post date | 2002-02-16T21:39:02Z |
Guido,
----- Original Message -----
From: <guido.klapperich@...>
> How can I get the index of the OrderingColumn ?
You could try something as:
var s:string;
OrderingField:TField;
Indice:Integer;
s:=Uppercase(GetOrdering(MyDataset, MyDataset.OrderingItemNo));
OrderingField:=MyDataset.FindField(s);
Indice:=OrderingField.Index;
function TMyform.GetOrdering( ds:Tdataset;ItemNo: integer ): string;
begin
with tiboquery(ds) do begin
if ItemNo = 0 then
Result := ''
else
with OrderingItems do
begin
Result := '';
if ( Abs( ItemNo ) <= Count ) then
begin
Result := IndexValues[ Abs( ItemNo ) - 1 ];
if getLitSafePos( ';', Result, 1 ) > 0 then
begin
if ItemNo > 0 then
Result := Copy( Result, 1, getLitSafePos( ';', Result, 1 ) - 1 )
else
Result := Copy( Result, getLitSafePos( ';', Result, 1 ) + 1,
maxint );
end
else
if ItemNo < 0 then
Result := ''; // Invalid ItemNo value.
end;
Result := Trim( Result );
end;
end;
end;
Luiz.