Rather than using the static names of graphical objects or windows, it is also possible to use the substitution names %WINDOW and %OBJECT.
%WINDOW
This name lets you reference the current window. It is valid within (in the broad sense) of a source block linked to a window, and lets you reference this window without using its external name.
%WINDOW lets you write generic code: the code will not need to be modified if the window is renamed or if the source is copied and pasted into a new window or the source of a PGO.
Example:
In the INITIALIZATION paragraph of the CLIENT_MANAGEMENT window, the following two code lines are strictly equivalent:
CLIENT_MANAGEMENT:Title = 'Client management'
is equivalent to
%WINDOW:Title = 'Client management'
Important: %WINDOW is meaningless outside a window (e.g. in the INIT PGM paragraph).
%OBJECT
This name lets you reference the current graphical object. It is valid within (in the broad sense) a source block linked to a graphical object, and lets you reference this object without using its external name.
%OBJECT lets you write generic code: the code will not need to be modified if the graphical object is renamed or if the source is copied and pasted into a new window or the source of a PGO.
Example:
In the EXIT_BUTTON:LeftButtonClick paragraph of the EXIT_BUTTON object, the following two code lines are strictly equivalent:
EXIT_BUTTON:Activity = *TRUE
is equivalent to
%OBJECT:Activity = *TRUE
Important: %OBJECT is meaningless outside the context of a graphical object (e.g. in the INIT PGM paragraph).