Subject FW: [IBO] Re: IndexFieldName with descending order
Author Support List
This will be fixed in the next release. (Build 10)

Jason

> > -----Original Message-----
> > From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
> > Behalf Of mayerherbert
> > Sent: Wednesday, January 12, 2011 2:12 AM
> > To: IBObjects@yahoogroups.com
> > Subject: [IBO] Re: IndexFieldName with descending order
> >
> >
> >
> >
> >
> >
> > Hi Jason - THX for answer :)
> >
> > Sorry but changing to indexname is definitly too much work for our
> > existing project. Too much uses of the descending ordering via the
> > IndexFieldNames.
> > ...The other problem is that in the current state IBO "deform" The
> > IndexFieldNames as soon as you open the unit with such tables in the
> > Delphi IDE. A IndexFieldName Property 'MyField1 desc;MyField2 desc' goes
> > to 'MyField1;desc;MyField2;desc' as soon you open the unit with such
> > TIBOTable's in the IDE. And with that automatic disformed code it gives
> > you an error by next runtime. ...so no acceptable state atm.
> >
> > We made a temporary fix in the the Procedure ExtractFieldName located in
> > the IB_Parse.pas to handle spaces as it was before.
> > I suggest you are using that basic procedure in a lot of internal cases,
> > so please can you take a look on it if theses changes are OK? (see the
> > {mrchange} marker)
> >
> > Tank you for your time and help
> > best regards
> >
> > // ---------------------------------------------------------------
> > function ExtractFieldName( const FieldNames: ansistring;
> > var Pos: integer ): ansistring;
> > var
> > ii: Integer;
> > tmpL: integer;
> > Lit: boolean;
> > SQ1: integer;
> > SQ2: integer;
> > procedure IncPos( SkipSpaces: boolean );
> > begin
> > Inc( ii );
> > while (not Lit) and
> > (ii <= tmpL) and
> > (FieldNames[ii] = ' ') and
> > SkipSpaces do
> > Inc( ii );
> > end;
> > begin
> > if Pos = ParseLineInvalid then
> > Pos := 1;
> > Lit := false;
> > SQ1 := 0;
> > SQ2 := 0;
> > tmpL := Length(FieldNames);
> > ii := Pos - 1;
> > IncPos( true ); // Gobble up leading spaces since we will use space as
> a
> > terminator now.
> > while (ii <= tmpL) do
> > begin
> > case FieldNames[ii] of
> > '"': Lit := not Lit;
> > '[': if not Lit then Inc( SQ1 );
> > ']': if not Lit then Dec( SQ1 );
> > '{': if not Lit then Inc( SQ2 );
> > '}': if not Lit then Dec( SQ2 );
> > {' ', mrchange 20100112 }',',';',#10,#13: if ( not Lit ) and ( SQ1
> +
> > SQ2 = 0 ) then Break;
> > end;
> > IncPos( false );
> > end;
> > Lit := false;
> > Result := Trim( Copy( FieldNames, Pos, ii - Pos ));
> > if (ii <= tmpL) and (FieldNames[ii] in [ {' ', mrchange 20100112 }
> ',',
> > ';' ] ) then IncPos( true );
> > if (ii <= tmpL) and (FieldNames[ii] = #13 ) then IncPos( true );
> > if (ii <= tmpL) and (FieldNames[ii] = #10 ) then IncPos( true );
> > Pos := ii;
> > end;
> > // ---------------------------------------------------------------