Jump to content
Fivewin Brasil

como obter o retorno do nome da variavel que esta sendo usado no GET


MAMP2

Recommended Posts

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

 

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...