Fill-In Leave-Trigger

BelaB

New Member
Hi!
I want that progress first writes the character into the fill-in, and AFTER THAT executes the leave trigger.
Is that possible?

Thanks
 
If you want to test the screen-value within the trigger, try a variation of the below in the ANY-PRINTABLE trigger.


AN ANY-PRINTABLE OF ..... DO:
DEF VAR cBefore AS CHAR NO-UNDO.
DEF VAR cAfter AS CHAR NO-UNDO.
ASSIGN cBefore = SELF:SCREEN-VALUE. /* Value prior to keystroke */
APPLY LASTKEY. /* bring up to date */
ASSIGN cAfter = SELF:SCREEN-VALUE. /* Value after keystroke */
IF cAfter EQ "A naughty word" THEN
ASSIGN SELF:SCREEN-VALUE = cBefore. /* Reset to previous */
/* other tests if needed */
RETURN NO-APPLY. /* because we already applied lastkey */
END.
 

BelaB

New Member
It's for a search fill-in of a browse!

I need something like this:

DO: /* ANY-PRONTABLE */

/* write/apply the last key */

FIND FIRST Program WHERE Program.ProgramName BEGINS SELF:SCREEN-VALUE NO-LOCK NO-ERROR.
IF AVAILABLE Program THEN
DO:
REPOSITION br-program TO RECID RECID(Program) NO-ERROR.
END.

/* Now don't write/apply the key */

END.

If I write "APPLY LASTKEY" progress apply's the key two times. At the beginning and at the end of the trigger.
The only solution I know is to delete the char with "SUBSTRING"!
Is there no easier way?
 
Top