Subject | TIB_SearchEdit & SearchingLinks Sample App |
---|---|
Author | Bob |
Post date | 2002-03-21T16:54:10Z |
I am working with lookups (as seen in the SearchingLinks Sample app) and do
not fully understand the sample code. I cannot find documentation for
TIB_Query property "ParamValueLinks" [the IBO help says that it's 'Not fully
implemented yet'], and for TIB_SearchEdit property ParamRefinePos. The code
from SearchingLinks demo is copied below.
Can anyone tell me why we go through so much code for Option 1 of the case
statement (and not Options 2 and 3), and what is going on there? I am
reproducing this search routine in my code and having some troubles,
probably because I don't quite understand the sample.
Thank you.
Bob.
----------------------------------------------------------------------------
------------
procedure TfrmSearchingLinks.qrSearchingLinksPrepareSQL(Sender:
TIB_Statement);
var
tmpStr: string;
begin
with qrSearchingLinks do begin
case Abs( OrderingItemNo ) of
1: begin
tmpStr := OldParamValueLinks.LinkValues[ 'EMP_NO' ];
if OrderingItemNo > 0 then begin
SQLWhereItems.Add( 'EMP_NO >= :EMP_NO' );
if (tmpStr = '-999') or (tmpStr = '') or (tmpStr = '999') then
begin
ParamValueLinks.Add( 'EMP_NO=-999' );
end;
end else begin
SQLWhereItems.Add( 'EMP_NO <= :EMP_NO' );
if (tmpStr = '-999') or (tmpStr = '') or (tmpStr = '999') then
begin
ParamValueLinks.Add( 'EMP_NO=999' );
end;
end;
seSearchingLinks.ParamRefinePos := 3;
end;
2: begin
SQLWhereItems.Add( 'UPPER( LAST_NAME ) STARTING WITH :LAST_NAME' );
seSearchingLinks.ParamRefinePos := 2;
end;
3: begin
SQLWhereItems.Add( 'UPPER( FIRST_NAME ) STARTING WITH
:FIRST_NAME' );
seSearchingLinks.ParamRefinePos := 2;
end;
end;
if cbSearchingLinks.ItemIndex <> Abs( OrderingItemNo ) - 1 then
cbSearchingLinks.ItemIndex := Abs( OrderingItemNo ) - 1;
end;
end;
not fully understand the sample code. I cannot find documentation for
TIB_Query property "ParamValueLinks" [the IBO help says that it's 'Not fully
implemented yet'], and for TIB_SearchEdit property ParamRefinePos. The code
from SearchingLinks demo is copied below.
Can anyone tell me why we go through so much code for Option 1 of the case
statement (and not Options 2 and 3), and what is going on there? I am
reproducing this search routine in my code and having some troubles,
probably because I don't quite understand the sample.
Thank you.
Bob.
----------------------------------------------------------------------------
------------
procedure TfrmSearchingLinks.qrSearchingLinksPrepareSQL(Sender:
TIB_Statement);
var
tmpStr: string;
begin
with qrSearchingLinks do begin
case Abs( OrderingItemNo ) of
1: begin
tmpStr := OldParamValueLinks.LinkValues[ 'EMP_NO' ];
if OrderingItemNo > 0 then begin
SQLWhereItems.Add( 'EMP_NO >= :EMP_NO' );
if (tmpStr = '-999') or (tmpStr = '') or (tmpStr = '999') then
begin
ParamValueLinks.Add( 'EMP_NO=-999' );
end;
end else begin
SQLWhereItems.Add( 'EMP_NO <= :EMP_NO' );
if (tmpStr = '-999') or (tmpStr = '') or (tmpStr = '999') then
begin
ParamValueLinks.Add( 'EMP_NO=999' );
end;
end;
seSearchingLinks.ParamRefinePos := 3;
end;
2: begin
SQLWhereItems.Add( 'UPPER( LAST_NAME ) STARTING WITH :LAST_NAME' );
seSearchingLinks.ParamRefinePos := 2;
end;
3: begin
SQLWhereItems.Add( 'UPPER( FIRST_NAME ) STARTING WITH
:FIRST_NAME' );
seSearchingLinks.ParamRefinePos := 2;
end;
end;
if cbSearchingLinks.ItemIndex <> Abs( OrderingItemNo ) - 1 then
cbSearchingLinks.ItemIndex := Abs( OrderingItemNo ) - 1;
end;
end;