Function GetActive() Foundation

Returns the Get object that has input focus.

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

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

Description

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.

Examples
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 "Inkey.ch" 

PROCEDURE Main 
   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 
   READ 

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

Feedback

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.