Sets the active field of a window.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X      


int active_field([field])
int               field


Always returns the new active field, which has been stored in the window-name.AF variable.

field (optional) specifies a new active field by its count. If field's value exceeds the window's field count, the function assumes the field with the highest value. If you don't give a value for field, the function returns the existing (current) active field.


Use active_field() when you want an active field if the current window. Use window-name.AF, where window-name is the name of the window, when you need the active field of a specific window.


Useful in the [TAB] trigger.
if (active_field() == active_field(active_field()+1))