/**********************************************************************/ /* If you subclass the Extended Text Entry object, then */ /* place the following code in the INIT section of your */ /* FRAME entry. */ INIT: call send(_frame_,'_get_widget_','obj1',objid); call send(objid,'_set_mode_','always'); return; /**********************************************************************/ /* If you override the _FEEDBACK_ method using the */ /* _SET_INSTANCE_METHOD_ method, then add the following */ /* code to the INIT section of your FRAME entry. */ call send(objid,'_set_instance_method_','_feedback_', 'sasuser.demo.methods.scl','feedback'); rc=insertc(objid,'',-1,'password'); rc=setlattr(objid,'AUTO',-1); /**********************************************************************/ /* The following code should be placed in the SCL entry */ /* for your _FEEDBACK_ method. */ length textval $ 30 password $ 30 str1 str2 $ 30; FEEDBACK: method event $ 20 line offset 8; call send(_self_,'_get_text_',textval); passlen=length(password); textlen=length(textval); if event='DELPREVCHAR' or event='DELCHAR' then do; str1=substr(password,1,offset-1); str2=substr(password,offset+1); password=str1||str2; end; else if event='PRINTABLE' then do; char=substr(textval,offset-1,1); str1=substr(password,1,offset-2); if textlen>passlen then do; if offset=2 then password=char||password; else do; str2=substr(password,offset-1); password=str1||char||str2; end; end; if offset <= textlen then do; str2=substr(password,offset); password=str1||char||str2; end; if offset=textlen+1 then do; password=str1||char; end; end; if textlen>0 then call send(_self_,'_set_text_',repeat('*',textlen-1)); call send(_self_,'_cursor_',1,offset); endmethod; /**********************************************************************/ /* To query the value for password */ CHECKPW: password=getnitemc(objid,'PASSWORD'); if password NE 'GOOFY' then _msg_='Password entered is incorrect. Please reenter.'; return; /**********************************************************************/