MAMP2 Posted March 19 Report Share Posted March 19 tenho uma tela com 10 gets, e previso saber no momento que o usuario teclar o F5 saber qual o nome da variavel que o Get esta no momento pra alimentar aquele get especifico, tem como fazer isto? Quote Link to comment Share on other sites More sharing options...
giovanyvecchi Posted March 19 Report Share Posted March 19 Dependendo do proposito há varias maneiras de verificar. Vou passar um exemplo: If oBtn1:lFocused ? "Botão 1" ElseIf oBtn2:lFocused ? "Botão 2 bla bla bla Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted March 19 Author Report Share Posted March 19 teria que ser alguma coisa que funcionasse como o ReadVar(), pois o ReadVar() nao esta funcionando. Quote Link to comment Share on other sites More sharing options...
giovanyvecchi Posted March 20 Report Share Posted March 20 Apresente sua rotina onde os gets estão dentro da DIALOG que ja faço a checagem. Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted March 20 Author Report Share Posted March 20 for i = 1 to 10 te_desc := "desc_"+strzero(i,2) te_larg := "larg_"+strzero(i,2) te_comp := "comp_"+strzero(i,2) te_altu := "altu_"+strzero(i,2) te_peso := "peso_"+strzero(i,2) te_tem := "tem_"+strzero(i,2) te_l_tl := "lintel_"+strzero(i,2) te_c_tl := "lintel_"+strzero(i,2) &te_desc := space(50) &te_larg := 0 &te_comp := 0 &te_altu := 0 &te_peso := i &te_tem := .f. &te_l_tl := "oget"+strzero(i,2) @ linha,00 say strzero(i,2) size sal_col*03,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*03) get &te_desc picture "@!" size sal_col*40,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*45) get &te_larg picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*55) get &te_comp picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*65) get &te_altu picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*75) get &te_l_tl var &te_peso picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*85) checkbox &te_tem prompt "Sem Peso" size sal_col*10,sal_lin of dl_det_nf3 pixel linha += sal_lin*2 next ********************* function busca_peso() ********************* var_t1 = ReadVar() msginfo(var_t1,"passou 1") Return (.t.) só pra mostrar o nome da variavel e nao vem nada Quote Link to comment Share on other sites More sharing options...
giovanyvecchi Posted March 20 Report Share Posted March 20 Voce esta com a lógica procedural do clipper em DOS. passa o código de onde começa o DEFINE DIALOG até o ACTIVATE DIALOG Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted March 20 Author Report Share Posted March 20 define dialog memvar->dl_det_nf3 from 00,01 TO 37,120 ; title memvar->te_cab2 ; font memvar->rec_for @ linha,00 say "it " of dl_det_nf3 pixel @ linha,coluna+(sal_col*3) say "Descricao" of dl_det_nf3 pixel @ linha,coluna+(sal_col*45) say "Largura" of dl_det_nf3 pixel @ linha,coluna+(sal_col*55) say "Comprim" of dl_det_nf3 pixel @ linha,coluna+(sal_col*65) say "altura." of dl_det_nf3 pixel @ linha,coluna+(sal_col*75) say "Peso " of dl_det_nf3 pixel @ linha,coluna+(sal_col*85) say "Sem Peso" of dl_det_nf3 pixel linha += sal_lin coluna = sal_col for i = 1 to 10 te_desc := "desc_"+strzero(i,2) te_larg := "larg_"+strzero(i,2) te_comp := "comp_"+strzero(i,2) te_altu := "altu_"+strzero(i,2) te_peso := "peso_"+strzero(i,2) te_tem := "tem_"+strzero(i,2) te_l_tl := "lintel_"+strzero(i,2) te_c_tl := "lintel_"+strzero(i,2) &te_desc := space(50) &te_larg := 0 &te_comp := 0 &te_altu := 0 &te_peso := i &te_tem := .f. &te_l_tl := "oget"+strzero(i,2) @ linha,00 say strzero(i,2) size sal_col*03,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*03) get &te_desc picture "@!" size sal_col*40,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*45) get &te_larg picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*55) get &te_comp picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*65) get &te_altu picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*75) get &te_l_tl var &te_peso picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*85) checkbox &te_tem prompt "Sem Peso" size sal_col*10,sal_lin of dl_det_nf3 pixel linha += sal_lin*2 next memvar->lin_mar = linha+sal_lin*23 memvar->col_mar = coluna*155 @ linha,coluna+(sal_col*15) button "&Finaliza" of dl_det_nf3 pixel size sal_col*10,10 action grav_ped() dl_det_nf3:bkeydown := {|nkey| iif ( nkey == VK_F5, busca_peso(),)} activate dialog dl_det_nf3 centered Return nil ********************* function busca_peso() ********************* var_t1 = ReadVar() msginfo(var_t1,"passou 1") Return (.t.) segue Quote Link to comment Share on other sites More sharing options...
giovanyvecchi Posted March 20 Report Share Posted March 20 Se quer o nome da variavel Get que esta em focus é assim define dialog memvar->dl_det_nf3 from 00,01 TO 37,120 ; title memvar->te_cab2 ; font memvar->rec_for @ linha,00 say "it " of dl_det_nf3 pixel @ linha,coluna+(sal_col*3) say "Descricao" of dl_det_nf3 pixel @ linha,coluna+(sal_col*45) say "Largura" of dl_det_nf3 pixel @ linha,coluna+(sal_col*55) say "Comprim" of dl_det_nf3 pixel @ linha,coluna+(sal_col*65) say "altura." of dl_det_nf3 pixel @ linha,coluna+(sal_col*75) say "Peso " of dl_det_nf3 pixel @ linha,coluna+(sal_col*85) say "Sem Peso" of dl_det_nf3 pixel linha += sal_lin coluna = sal_col for i = 1 to 10 te_desc := "desc_"+strzero(i,2) te_larg := "larg_"+strzero(i,2) te_comp := "comp_"+strzero(i,2) te_altu := "altu_"+strzero(i,2) te_peso := "peso_"+strzero(i,2) te_tem := "tem_"+strzero(i,2) te_l_tl := "lintel_"+strzero(i,2) te_c_tl := "lintel_"+strzero(i,2) &te_desc := space(50) &te_larg := 0 &te_comp := 0 &te_altu := 0 &te_peso := i &te_tem := .f. &te_l_tl := "oget"+strzero(i,2) @ linha,00 say strzero(i,2) size sal_col*03,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*03) get &te_desc picture "@!" size sal_col*40,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*45) get &te_larg picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*55) get &te_comp picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*65) get &te_altu picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*75) get &te_l_tl var &te_peso picture "@E 9999.999" size sal_col*09,10 of dl_det_nf3 pixel @ linha,coluna+(sal_col*85) checkbox &te_tem prompt "Sem Peso" size sal_col*10,sal_lin of dl_det_nf3 pixel linha += sal_lin*2 next memvar->lin_mar = linha+sal_lin*23 memvar->col_mar = coluna*155 @ linha,coluna+(sal_col*15) button "&Finaliza" of dl_det_nf3 pixel size sal_col*10,10 action grav_ped() dl_det_nf3:bkeydown := <|nkey| Local _cNameVarRet := "" if nkey == VK_F5 AEval(dl_det_nf3:aControls,<|_aCtrl| If _aCtrl:ClassName() == "TGET" If _aCtrl:lFocused _cNameVarRet := _aCtrl:oGet:nAme EndIf EndIf Return Nil >) ? _cNameVarRet EndIf Return Nil > //cEnd activate dialog dl_det_nf3 centered Return nil 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.