I know that VALID will fire before the focus goes to the next object, and WHEN is to decide whether the DCGET greyed out or not.
Code: Select all
@1,71 DCGET MREFNO popup {|c| c:=GETREFNO(COM_TYPE,aLocals,' '),;
EVAL ({|c| SEEK_ORDER(c,COM_TYPE,xARRAY,aLocals,xNEWARRAY,bTASK),DC_GETREFRESH(GETLIST)},c),c};
VALID {|x| x:=SEEK_ORDER(MREFNO,COM_TYPE,xARRAY,aLocals,xNEWARRAY,bTASK),DC_GETREFRESH(GETLIST),x };
WHEN {|| .F. } LOSTFOCUS BREFRESH GETSIZE 9.8 PICTURE '@!' COLOR MGETCOLOR1,MGETCOLOR2
@2,71 DCGET MCHEQUE PICTURE '@!' COLOR MGETCOLOR1,MGETCOLOR2;
VALID {|x| OLDCHQ:=MREFNO,x:=CA_DUPCHQ(OLDCHQ,xARRAY,xNEWARRAY,COM_TYPE,aLocals),dc_getrefresh(getlist),x} GETSIZE 12;
WHEN {|| EMPTY(MCHEQUE) .OR. COM_TYPE = '3' }
But if I input something to MCHEQUE, CA_DUPCHQ will not run and the focus will automatically move to the next object. I've already put msgboxes inside CA_DUPCHQ, but those msgboxes never appear.
Strange part for me is that, if I remove the WHEN on the second DCGET,
Code: Select all
@2,71 DCGET MCHEQUE PICTURE '@!' COLOR MGETCOLOR1,MGETCOLOR2;
VALID {|x| OLDCHQ:=MREFNO,x:=CA_DUPCHQ(OLDCHQ,xARRAY,xNEWARRAY,COM_TYPE,aLocals),dc_getrefresh(getlist),x} GETSIZE 12
Anyone else have this issue? or is it just my understanding of VALID and WHEN that is wrong?
Regards,
Andy