João,
Aqui tienes un ejemplo completo y funcionando:
test.prg
Code: Select all
#include "FiveWin.ch"
function Main()
local oDlg, aValues[ 4 ], n, oGet
SET KEY VK_F2 TO ShowInfo()
DEFINE DIALOG oDlg RESOURCE "Test" TITLE "Pulsa F2 para ReadVar()"
for n = 1 to 4
aValues[ n ] = PadL( Str( n ), 20 )
oGet = TGet():Redefine( 100 + ( n - 1 ) * 10, GenSetGet( aValues, n ), oDlg )
oGet:oGet:Name = "aValues[" + AllTrim( Str( n ) ) + "]"
next
ACTIVATE DIALOG oDlg CENTERED
return nil
function GenSetGet( aValues, n )
return bSETGET( aValues[ n ] )
function ShowInfo()
MsgInfo( ReadVar() )
return nil
function ReadVar()
local nWnd := AScan( GetAllWin(),;
{ | oWnd | oWnd:lFocused .and. oWnd:ClassName() == "TGET" } )
return If( nWnd != 0, GetAllWin()[ nWnd ]:oGet:Name, Nil )
test.rc
Code: Select all
test DIALOG 119, 76, 194, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
EDITTEXT 100, 53, 10, 108, 14
EDITTEXT 110, 53, 29, 108, 14
EDITTEXT 120, 53, 48, 108, 14
EDITTEXT 130, 53, 67, 108, 14
DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14
}