MAMP2 Posted February 2 Report Share Posted February 2 Estou procurando uma funcao que me de o nome da variavel que esta sendo usada no Get existe? Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted February 2 Author Report Share Posted February 2 ou seja, quando cursor estiver no get correspondente uma funcao que mostre qual o nome da variavel que esta sendo "getada" nequele lugar onde o cursor esta Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 2 Report Share Posted February 2 Isto? Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted February 2 Report Share Posted February 2 #include "FiveWin.ch" function Main() LOCAL oDlg, oGet LOCAL cCad := "Testing " // pad("Testing Gets",40) LOCAL nNum := 0 LOCAL dDat := Date() Set century On Set Date Ansi Set Date format "mm/dd/yyyy" SET _3DLOOK ON DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION SetKey(VK_F3, {|| MostraGet(oDlg) } ) @ 1, 2 SAY "Text..:" OF oDlg @ 1, 6 GET oGet VAR cCad OF oDlg SIZE 60, 10 COLOR "W/G" PICTURE "@K" @ 1.8, 2 SAY "Number:" OF oDlg @ 2, 6 GET oGet VAR nNum OF oDlg SIZE 60, 10 PICTURE "9999999.99" @ 2.6, 2 SAY "Date:" OF oDlg @ 3, 6 GET oGet VAR dDat PICTURE "@E" OF oDlg SIZE 60, 10 // "@D" @ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End() @ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL ACTIVATE DIALOG oDlg CENTERED return nil //------------------------------------------------------------------------// Function MostraGet(oDlg) Local oGetAtual := oDlg:oCtlFocus //exibe nome da variável e seu conteúdo ? oGetAtual:oGet:Name,oGetAtual:oGet:Buffer Return nil Quote Link to comment Share on other sites More sharing options...
Eric.Developer Posted February 9 Report Share Posted February 9 @Jmsilva observe que este não é o modo correto da janela checar uma tecla, não deve ser utilizado. Caso não saiba como fazer, me avise por mensagem privada. Em 02/02/2024 at 19:05, Jmsilva disse: DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION SetKey(VK_F3, {|| MostraGet(oDlg) } ) Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted March 19 Author Report Share Posted March 19 jmsilva esta dando erro na compilacao nesta linha, tem alguma coisa errada? oGetAtual:oGet:Name,oGetAtual:oGet:Buffer Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted March 20 Report Share Posted March 20 Function MostraGet(oDlg) Local oGetAtual := oDlg:oCtlFocus //exibe nome da variável e seu conteúdo ? oGetAtual:oGet:Name,oGetAtual:oGet:Buffer Return nil Na linha não. Get atual ele pega do objeto janela, vc poderia verificar se foco está em um objeto get. Assim: Function MostraGet(oDlg) Local oGetAtual := oDlg:oCtlFocus //exibe nome da variável e seu conteúdo If Hb_IsObject(oGetAtual) .and. oGetAtual:ClassName() == "TGET" ? oGetAtual:oGet:Name,oGetAtual:oGet:Buffer Endif Return Nil Possível erro pode ser focu em outro objeto que não seja o objeto do TGET. ok Quote Link to comment Share on other sites More sharing options...
Theotokos Posted March 21 Report Share Posted March 21 Em 19/03/2024 at 19:24, MAMP2 disse: jmsilva esta dando erro na compilacao nesta linha, tem alguma coisa errada? oGetAtual:oGet:Name,oGetAtual:oGet:Buffer se é na compilação então vc não concluir a linha correto... esta linha tem um ? (exclamação) no inicio... Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted March 21 Report Share Posted March 21 2 horas atrás, Theotokos disse: se é na compilação então vc não concluir a linha correto... esta linha tem um ? (exclamação) no inicio... Vc está usando o #include "fivewin.ch" ? Tem haver com ponto exclamação. #command ? [ <list,...> ] => WQout( [ \{ <list> \} ] ) O Ponto de exclamação eu uso para visualizar, pode mudar para: msginfo(oGetAtual:oGet:Name) //nome da variável msginfo(oGetAtual:oGet:Buffer) //conteúdo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.