Form S_189FK

LANSA

Form S_189FK

*===================================================================;
*;
* Component : S_189FK;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : SELECT_SQL - parameter (NOT) LIKE; ;
*;
* Disclaimer : The following material is supplied as sample material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM HEIGHT(299) LEFT(304) TOP(115) WIDTH(434);
DEFINE_COM CLASS(#PRIM_LTVW) NAME(#LTVW_1) DISPLAYPOSITION(1) HEIGHT(233) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(1) TOP(16) WIDTH(170);
DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_1) DISPLAYPOSITION(1) PARENT(#LTVW_1) SOURCE(#SURNAME) WIDTH(21) WIDTHTYPE(Remainder);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_1) CAPTION('LIKE or NOT LIKE') DISPLAYPOSITION(2) HEIGHT(73) LEFT(184) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(8) WIDTH(121);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_1) BUTTONCHECKED(True) CAPTION('LIKE') DISPLAYPOSITION(1) LEFT(11) PARENT(#GPBX_1) TABPOSITION(1) TOP(16) WIDTH(54);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_2) CAPTION('NOT LIKE') DISPLAYPOSITION(2) LEFT(11) PARENT(#GPBX_1) TABPOSITION(2) TOP(40) WIDTH(78);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_2) CAPTION('Selection examples') DISPLAYPOSITION(3) HEIGHT(161) LEFT(184) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(88) WIDTH(240);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_3) BUTTONCHECKED(True) CAPTION('All names, first character = ''B''') DISPLAYPOSITION(1) LEFT(8) PARENT(#GPBX_2) TABPOSITION(1) TOP(18) WIDTH(225);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_4) CAPTION('All names with character ''B'' in it') DISPLAYPOSITION(2) LEFT(8) PARENT(#GPBX_2) TABPOSITION(2) TOP(44) WIDTH(225);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_5) CAPTION('All names with second character = ''L''') DISPLAYPOSITION(3) LEFT(8) PARENT(#GPBX_2) TABPOSITION(3) TOP(70) WIDTH(225);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_6) CAPTION('All names with exactly 5 characters') DISPLAYPOSITION(4) LEFT(8) PARENT(#GPBX_2) TABPOSITION(4) TOP(96) WIDTH(225);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_7) CAPTION('All names with at least 5 characters') DISPLAYPOSITION(5) LEFT(8) PARENT(#GPBX_2) TABPOSITION(5) TOP(122) WIDTH(225);
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
clr_list #ltvw_1;
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME LIKE ''B%''');
add_entry #ltvw_1;
endselect;
ENDROUTINE;
;
EVTROUTINE HANDLING(#RDBN_1.Click);
execute subroutine(selection);
ENDROUTINE;
EVTROUTINE HANDLING(#RDBN_2.Click);
execute subroutine(selection);
ENDROUTINE;
EVTROUTINE HANDLING(#RDBN_3.Click);
execute subroutine(selection);
ENDROUTINE;
EVTROUTINE HANDLING(#RDBN_4.Click);
execute subroutine(selection);
ENDROUTINE;
EVTROUTINE HANDLING(#RDBN_5.Click);
execute subroutine(selection);
ENDROUTINE;
EVTROUTINE HANDLING(#RDBN_6.Click);
execute subroutine(selection);
ENDROUTINE;
EVTROUTINE HANDLING(#RDBN_7.Click);
execute subroutine(selection);
ENDROUTINE;
;
SUBROUTINE NAME(SELECTION);
clr_list #ltvw_1;
if '#rdbn_1.ButtonChecked = True';
*;
* LIKE option selected;
if '#rdbn_3.ButtonChecked = True';
* All names, first characters = 'B';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME LIKE ''B%''');
add_entry #ltvw_1;
endselect;
endif;
*;
* All names with character 'B' in it;
if '#rdbn_4.ButtonChecked = True';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME LIKE ''%B%''');
add_entry #ltvw_1;
endselect;
endif;
*;
* All names with second character = 'L';
if '#rdbn_5.ButtonChecked = True';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME LIKE ''_L%''');
add_entry #ltvw_1;
endselect;
endif;
*;
* All names with exactly 5 characters;
if '#rdbn_6.ButtonChecked = True';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME LIKE ''_____''');
add_entry #ltvw_1;
endselect;
endif;
*;
* All names with at least 5 characters;
if '#rdbn_7.ButtonChecked = True';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME LIKE ''_____%''');
add_entry #ltvw_1;
endselect;
endif;
else;
*;
* NOT LIKE option selected;
if '#rdbn_3.ButtonChecked = True';
* All names, first characters = 'B';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME NOT LIKE ''B%''');
add_entry #ltvw_1;
endselect;
endif;
*;
* All names with character 'B' in it;
if '#rdbn_4.ButtonChecked = True';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME NOT LIKE ''%B%''');
add_entry #ltvw_1;
endselect;
endif;
*;
* All names with second character = 'L';
if '#rdbn_5.ButtonChecked = True';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME NOT LIKE ''_L%''');
add_entry #ltvw_1;
endselect;
endif;
*;
* All names with exactly 5 characters;
if '#rdbn_6.ButtonChecked = True';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME NOT LIKE ''_____''');
add_entry #ltvw_1;
endselect;
endif;
*;
* All names with at least 5 characters;
if '#rdbn_7.ButtonChecked = True';
SELECT_SQL FIELDS(#SURNAME) FROM_FILES((PSLMST)) WHERE('SURNAME NOT LIKE ''_____%''');
add_entry #ltvw_1;
endselect;
endif;
endif;
ENDROUTINE;
END_COM;
;