Find Where "Entry" is Currently Applied

Phillip

Member
Is there a way to find what field "entry" is currently applied to? I want a button to run two functions: one for each field depending on which field is being used at the time of clicking the button. I know the command 'Apply "Entry" to FIELD1' but I want something similar to the following:

Code:
IF "ENTRY" ON FIELD1 THEN DO:
END.

Thank you
 

GregTomkins

Active Member
Clicking the button should generate a LEAVE event of the field you were in immediately prior to clicking. So you could watch for that use it to set a global variable that indicates that most recently left field. Watch out for buttons that are activated by means other than a click: eg. RETURN when the button is defined as the default, and using the keyboard mnemonic instead of the mouse. It's been a while since I've done ABL GUI, but I vaguely recall that LEAVE events aren't necessarily generated in these cases. You could also check to see if the FOCUS handle is useful but in your example I doubt it would be.
 

TheMadDBA

Active Member
That would seem to be very confusing to the users. That being said... You could do something like Greg said or put an ON ENTRY for those two fields and store the value in a variable.

My style preference would be to change the design so that the button doesn't mean two things, or at least change the button label depending on which field you are in.
 
Top