Enrico Maria Giordano wrote:You are not trying my last code. Try it, please. It is not working.
EMG
There is no difference between both codes in their operation.
Anyway, I have used your code to test it and it works fine.
- Code: Select all Expand view
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL cVr1 := SPACE( 30 )
LOCAL cVr2 := SPACE( 30 )
DEFINE DIALOG oDlg
@ 1, 1 GET cVr1 OF oDlg VALID !EMPTY( GETACTIVE( oDlg ):VarGet() ) SIZE 50, 18 PIXEL
@ 25, 1 GET cVr2 OF oDlg SIZE 50, 18 PIXEL
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
FUNCTION GETACTIVE( oDlg )
LOCAL i
Local oObj
FOR i = 1 TO LEN( oDlg:aControls )
IF oDlg:aControls[ i ]:HasFocus()
? oDlg:aControls[ i - IF( i = 1, 0, 1 ) ]:VarGet()
RETURN oDlg:aControls[ i - IF( i = 1, 0, 1 ) ]
ENDIF
NEXT
RETURN nil