Hola Sudip !!
Lamento si he creado confusión al respecto. Mi interpretación del tema que estaban tratando fue la de evaluar la posibilidad de modificar, en tiempo de ejecución, la acción asignada al evento ON CHANGE en la definición de un control.
Ejemplo:
// Defino el control cuando se crea la interfaz de usuario
DEFINE WINDOW oWnd
DEFINE CONTROL oControl
ON CHANGE ( Accion_01() ) ...
END CONTROL
END WINDOW
// Modifico el valor en tiempo de ejecución como modo de parametrización de la interfaz
FUNCTION CONTEXTO_EJECUCION( _cContexto )
// ¿ Existe la propiedad .bOnChange ?
If _cContexto == "01"
oWnd.oControl.
:= {||Accion_01()}
Else
oWnd.oControl.
:= {||Accion_02()}
EndIf
RETURN
Analizando el problema según tu descripción, mi humilde opinión es:
Un evento, es comprendido por todos como la respuesta a una determinada acción. Si llegamos al consenso de especificar que un evento se encuentra directamente asociado a la acción del operador sobre el control ( presión de una tecla, presión de un botón del mause, desplazamiento del puntero del mause, etc. ), entonces queda claro, para mí, que debe seguir existiendo la diferencia de comportamiento ya que la asignación programática de un nuevo valor no es una acción del usuario y brinda mayor libertad al programador.
Ejemplo:
// Genero un nuevo valor procesando el ingresado por el usuario
oWnd.oControl.Value := Formateo_Contenido(oWnd.oControl.value)
CONCLUSION
Creo que en ambas interpretaciones del tema hay un punto en común: Debería implementarse una propiedad bOnChange
INTERPRETACION 01
...
If _cContexto == "01"
oWnd.oControl.bOnChange := {||Accion_01()}
Else
oWnd.oControl.bOnChange := {||Accion_02()}
EndIf
...
INTERPRETACION 02
...
// Modifico el contenido de la propiedad
oWnd.oControl.Value := Formateo_Contenido(oWnd.oControl.value)
// Fuerzo la ejecución del evento CHANGE sólo en los casos donde lo necesite
uResultado := Eval(oWnd.oControl.bOnChange)
...
Saludos !!
GOOGLE TRANSLATION
Sudip Hello!
I am sorry if I have created confusion on the matter. My interpretation of the theme they were trying was to evaluate the possibility of modifying, at runtime, the action assigned to event ON CHANGE in the definition of a control.
Example:
/ / Set control when creating the user interface
DEFINE WINDOW oWnd
DEFINE CONTROL oControl
ON CHANGE (Accion_01 ()) ...
END CONTROL
END WINDOW
/ / Changing the value at runtime as a way of parametrization of the interface
FUNCTION CONTEXTO_EJECUCION (_cContexto)
/ / Does the property. BOnChange?
If _cContexto == "01"
oWnd.oControl. ::: = (| | Accion_01 ())
Else
oWnd.oControl. ::: = (| | Accion_02 ())
ENDIF
RETURN
Analyzing the problem as your description, my humble opinion is:
An event, it is understood by all as a response to a particular action. If we reach the consensus to specify that an event is directly associated with the action of the operator in the control (pressing a key, pressing a mouse button, moving the mouse pointer, etc..), Then it is clear to me which should remain the difference in behavior since the program allocation of a new value is not a user action and provides greater freedom to the programmer.
Example:
/ / Generate a new value to process the input by the user
oWnd.oControl.Value: = Formateo_Contenido (oWnd.oControl.value)
CONCLUSION
I think that both interpretations of the theme there is one point in common: a property should be implemented bOnChange
Interpretation 01
...
If _cContexto == "01"
oWnd.oControl.bOnChange: = (| | Accion_01 ())
Else
oWnd.oControl.bOnChange: = (| | Accion_02 ())
ENDIF
...
Interpretation 02
...
/ / Modifying the contents of the property
oWnd.oControl.Value: = Formateo_Contenido (oWnd.oControl.value)
/ / Force the implementation of the Change event only in cases where you need it
uResultado: = Eval (oWnd.oControl.bOnChange)
...
Greetings!