Form VL_SAM038: Handling a Password Field
Name: VL_SAM038
Description: The following RDMLX form demonstrates how to handle a password field.
===================================================================;
*;
* Component : VL_SAM038;
* Type : Form;
* Ancestor : PRIM_FORM;
* ;
* Description : Handling a password field;
*;
* 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 CAPTION('Password Test') FORMPOSITION(ScreenCenter) HEIGHT(145) LEFT(162) TOP(231) WIDTH(302);
DEFINE_COM CLASS(#PRIM_EDIT) NAME(#EDIT_1) DISPLAYPOSITION(1) HEIGHT(19) LEFT(108) PARENT(#COM_OWNER) PASSWORDCHAR('*') SHOWSELECTION(False) TABPOSITION(1) TOP(48) WIDTH(60);
DEFINE_COM CLASS(#USER.Visual) NAME(#USER) CAPTION('Current User :') DISPLAYPOSITION(2) HEIGHT(19) LABELTYPE(Caption) LEFT(8) MARGINLEFT(100) PARENT(#COM_OWNER) READONLY(True) TABPOSITION(2) TOP(15) WIDTH(160);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) CAPTION('Password :') DISPLAYPOSITION(3) HEIGHT(19) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(48) WIDTH(81);
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(4) HEIGHT(24) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(94) WIDTH(294);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#CHECKBTN) CAPTION('Check Password ') DISPLAYPOSITION(5) LEFT(192) PARENT(#COM_OWNER) TABPOSITION(5) TOP(16) WIDTH(97);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#HINTBTN) CAPTION('Hint ') DISPLAYPOSITION(6) HEIGHT(26) HINT('The password is xyz') LEFT(192) PARENT(#COM_OWNER) TABPOSITION(6) TOP(48) WIDTH(97);
* ;
define #use_passw *char 10 default(*blanks);
* ;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
CHANGE FIELD(#USER) TO(USER);
ENDROUTINE;
* ;
EVTROUTINE HANDLING(#CHECKBTN.Click);
* Note the PasswordChar property of #EDIT_1 ;
;
CHANGE #USE_PASSW #EDIT_1.VALUE;
USE BUILTIN(UPPERCASE) WITH_ARGS(#USE_PASSW) TO_GET(#USE_PASSW);
IF COND('#USE_PASSW *EQ ''XYZ''');
MESSAGE MSGTXT('Correct password. Well done!') ;
else;
MESSAGE MSGTXT('Wrong password. Try clicking on the Hint button.') ;
ENDIF;
ENDROUTINE;
* ;
EVTROUTINE HANDLING(#HINTBTN.Click);
MESSAGE MSGTXT('The password is xyz');
ENDROUTINE;
;
EVTROUTINE HANDLING(#EDIT_1.GotFocus);
ENDROUTINE;
END_COM;
;
Name: VL_SAM038
Description: The following RDMLX form demonstrates how to handle a password field.
===================================================================;
*;
* Component : VL_SAM038;
* Type : Form;
* Ancestor : PRIM_FORM;
* ;
* Description : Handling a password field;
*;
* 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 CAPTION('Password Test') FORMPOSITION(ScreenCenter) HEIGHT(145) LEFT(162) TOP(231) WIDTH(302);
DEFINE_COM CLASS(#PRIM_EDIT) NAME(#EDIT_1) DISPLAYPOSITION(1) HEIGHT(19) LEFT(108) PARENT(#COM_OWNER) PASSWORDCHAR('*') SHOWSELECTION(False) TABPOSITION(1) TOP(48) WIDTH(60);
DEFINE_COM CLASS(#USER.Visual) NAME(#USER) CAPTION('Current User :') DISPLAYPOSITION(2) HEIGHT(19) LABELTYPE(Caption) LEFT(8) MARGINLEFT(100) PARENT(#COM_OWNER) READONLY(True) TABPOSITION(2) TOP(15) WIDTH(160);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_1) CAPTION('Password :') DISPLAYPOSITION(3) HEIGHT(19) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(48) WIDTH(81);
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(4) HEIGHT(24) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(94) WIDTH(294);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#CHECKBTN) CAPTION('Check Password ') DISPLAYPOSITION(5) LEFT(192) PARENT(#COM_OWNER) TABPOSITION(5) TOP(16) WIDTH(97);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#HINTBTN) CAPTION('Hint ') DISPLAYPOSITION(6) HEIGHT(26) HINT('The password is xyz') LEFT(192) PARENT(#COM_OWNER) TABPOSITION(6) TOP(48) WIDTH(97);
* ;
define #use_passw *char 10 default(*blanks);
* ;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
CHANGE FIELD(#USER) TO(USER);
ENDROUTINE;
* ;
EVTROUTINE HANDLING(#CHECKBTN.Click);
* Note the PasswordChar property of #EDIT_1 ;
;
CHANGE #USE_PASSW #EDIT_1.VALUE;
USE BUILTIN(UPPERCASE) WITH_ARGS(#USE_PASSW) TO_GET(#USE_PASSW);
IF COND('#USE_PASSW *EQ ''XYZ''');
MESSAGE MSGTXT('Correct password. Well done!') ;
else;
MESSAGE MSGTXT('Wrong password. Try clicking on the Hint button.') ;
ENDIF;
ENDROUTINE;
* ;
EVTROUTINE HANDLING(#HINTBTN.Click);
MESSAGE MSGTXT('The password is xyz');
ENDROUTINE;
;
EVTROUTINE HANDLING(#EDIT_1.GotFocus);
ENDROUTINE;
END_COM;
;