Functions and Directives

Function GetActive() Foundation

Returns the Get object that has input focus.

GetActive( [<oGet>] ) --> oGet | NIL
If the optional parameter <oGet> is passed, it becomes the active Get object.

GetActive() returns the Get object that currently has input focus. If no Get object has focus, GetActive() returns NIL.


GetActive() is a service function of the Xbase++ Get system. It returns the Get object which has input focus and can also be used to set focus to the Get object passed as an optional argument.

GetActive(), as a rule, is only used for determining the active Get object so that messages can be sent to it. It is often used with another function such as SetAppEvent() or in a SetKey() procedure.

GetActive() usage in a SET KEY function
// In the example, a code block that allows a READ to be terminated is 
// assigned to the F10 key. The code block determines the active 
// Get object and sets its exit status to terminate the READ. 

#include "" 

   LOCAL cString := "A String", nNumber := 10, bBlock 

   // Save the old code block and provide a new one 
   bBlock := SetKey( K_F10, {|| GetActive():exitState := GE_WRITE} ) 

   @ 10,10 SAY "Text  :" GET cString 
   @ 12,10 SAY "Number:" GET nNumber 

   SetKey( K_F10, bBlock )          // Reinstall old code block 


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.