Sometimes in our applications we need to evalute special conditions or use auxiliar methods, on User Events. To acomplish that on GeneXus X Evolution 2 we needed to call a procedure to evaluate the condition (or exectue the method) and return the result back. As from GeneXus X Evolution 3, we are able to evaluate complex conditions, and use auxiliar methods on User Events.
The following things could be inside an expression:
- Variables
- Attributes
- Constants
- Methods
- Functions
- Control properties
- Operators (+, -, *, /, ^)
Event 'clientEvent'
&Number1 = 45
&Number2 = 34
If &Number1 > &Number2
msg('Condition evaluated successfully')
Endif
EndEvent
Event 'clientEvent'
&String = &Number.ToString()
EndEvent
The following are some of the benefits of this feature:
- Avoid calling a procedure for every complex condition evaluated on user events.
- Avoid calling a procedure for every auxiliar method used on user events.
- More clarity on your GeneXus code.