Subject Re: [IBO] errors with TIB_LookupCombo
Author Geoff Worboys
> I'm not sure on what code to assign in the OnCustomCompareStr
> event.

function TForm1.IB_Connection1CustomCompareStr(IB_Field: TIB_Column;
const S1, S2: String): Integer;
Result := CompareStr(S1, S2);

function TForm1.IB_Connection1CustomCompareText(IB_Field: TIB_Column;
const S1, S2: String): Integer;
Result := CompareText(S1, S2);

The above should work for character set NONE fields.

> What is the code actually supposed to do?

It tells IBO what code to use when comparing strings.

> How does this event manipulate the outcome?

When IBO needs to decide whether to progress to the next or prior
row in a dataset it may have to compare text values. The the
search value is GT the current row then IBO needs to go forward.

Since text comparisons control the order, using ANSI comparisons
against text ordered by ASCII gives curious results. The results
are often very strange because IBO will try to jump backwards
and forwards to minimise the number of comparisons required.

> How do I handle the outcome?

Just give the code as above, there should not be anything else to
it unless you are using some character set other than NONE.

> The help for this event is quite brief.

I agree.

Geoff Worboys
Telesis Computing