Geraldo (gbsilva) Posted February 4, 2005 Report Share Posted February 4, 2005 Pessoal o comando abaixo é um GET, onde eu digito 12 [ENTER] e automático já apareça "0012" só que não aparece, se eu sair do GET e retornar a ele ai aparece. O que está errado alguém tem idéia. REDEFINE GET pDist1 ID 31 OF oFld:aDialogs[2] PICTURE "@K9999" ; VALID(IIf(empty(pDist1),.T. ,; Eval({||pDist1 := strzero(val(pDist1),4),.T.}))) UPDATE ; FONT oFont ; COLORS CLR_BLUE, CLR_WHITE Obrigado Geraldo Barbosa da Silva Clipper 5.2e FiveWin lucgera@terra.com.br Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 4, 2005 Report Share Posted February 4, 2005 Tente: REDEFINE GET pDist1 ID 31 OF oFld:aDialogs[2] PICTURE "@K ##99" // Ou "!!99" Bad Boy - The HuntsMan Of E.A.J. Automação Comercial. kapiaba@brfree.com.br FW 2.3C CLIPPER 5.3B BLINKER 7.0 WORKSHOP.EXE Quote Link to comment Share on other sites More sharing options...
Geraldo (gbsilva) Posted February 4, 2005 Author Report Share Posted February 4, 2005 kapiaba não funcionou, tentei os 02 jeitos. Geraldo Barbosa da Silva Clipper 5.2e FiveWin lucgera@terra.com.br Quote Link to comment Share on other sites More sharing options...
jef2_tim Posted February 4, 2005 Report Share Posted February 4, 2005 cara .. tipo... no seu valid vc pode fzer issu normalmente... o interessante é q vc esta deixndo o pic como numerico e nao pode... entende... REDEFINE GET oDist1 Var pDist1 ID 31 OF oFld:aDialogs[2] PICTURE "@!" ; VALID Ver_pDist1(pDist1); UPDATE ; FONT oFont ; COLORS CLR_BLUE, CLR_WHITE Valid Ver_pDist1(pDist1) function pdist1(Dist1) If Empty(Dist1) Return .F. Else pDist1 := Strzero(val(Dist1),5) oDist1:Refresh() return .t. Endif acho q seria algo assim... Um Xharbraço Pra Todos Os Amigos. Uso Fwh 2.5 (xharbour 0.99) e Xmate Para Compilar Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 4, 2005 Report Share Posted February 4, 2005 pDist1 -> Isto é Númerico? Bad Boy - The HuntsMan Of E.A.J. Automação Comercial. kapiaba@brfree.com.br FW 2.3C CLIPPER 5.3B BLINKER 7.0 WORKSHOP.EXE Quote Link to comment Share on other sites More sharing options...
jef2_tim Posted February 4, 2005 Report Share Posted February 4, 2005 pelo q percebi..ele quer entrar com um numero e o sistema fazer um valid ... e retornar uma string com zeros... tipo.. ele digita 12 e o sistema retorna no mesmo get 00012 entaum.. para retornar string o get dele nao pode estar com picture numerico ... se naum vai mostrar 12 sempre e naum 00012 ... por issu o valid como funcao pq ele tratará as duas coisas.... tanto verificar se esta vazio quanto enviar a strngzero para ele agora nao esqueca do refresh se nao nao vai dar e tens de ter um objeto ne ... se naum naum tem objeto para dar refresh ... eu acho q seria issu Um Xharbraço Pra Todos Os Amigos. Uso Fwh 2.5 (xharbour 0.99) e Xmate Para Compilar Quote Link to comment Share on other sites More sharing options...
bluesman Posted February 20, 2005 Report Share Posted February 20, 2005 geraldao: eu mexeria, como ja fiz um monte de vezes, na classe TGet ! Fica a solução pra sempre... verifica no método de entrada o do case que avalia as clausulas de picture. acrescente uma clausula para interpretar o "stringzero" ! Tipo valor := 1 @ 10,10 get var valor picture "@Z 99999" modifica a classe para interpretar o "Z" acima como string zero no display e na entrada da variavel do get, para ele mostrar de cara 00001. fica bala ! inclusive, por exemplo eu criei uma clausula "@W" ! sabe pra que ?? para entrar endereco de email sempre em minuscula mesmo com caps lock ligado! fica bala ! eu enriqueci os pictures, fazendo uma coleçao minha mesmo! alias o FW já podia ter isso la nao é? senao entendeu, manda q explico mais ! abr FW1.92+Clipper 5.3+Lib+Blinker+BC++ Quote Link to comment Share on other sites More sharing options...
vagner Posted February 20, 2005 Report Share Posted February 20, 2005 Ola Geraldo citação:REDEFINE GET pDist1 ID 31 OF oFld:aDialogs[2] PICTURE "@K9999" ; VALID(IIf(empty(pDist1),.T. ,; Eval({||pDist1 := strzero(val(pDist1),4),.T.}))) UPDATE ; FONT oFont ; COLORS CLR_BLUE, CLR_WHITE id=quote>id=quote>REDEFINE GET oDist1 Var pDist1 ID 31 OF oFld:aDialogs[2] PICTURE "@K9999" ; VALID(IIf(empty(pDist1),.T. ,; Eval({||pDist1 := strzero(val(pDist1),4),.T.})),oDist1:Refresh()) UPDATE ; FONT oFont ; COLORS CLR_BLUE, CLR_WHITE Olha, vc nao esta acostumado a usar os objetos pelo que eu pude notar , comece a usar principalmente em gets, para que vc possa dar um refresh() No caso do Update so ira atualizar qdo vc mandar dar um refresh() na dialog ok ? Vagner Wirts Clipper 5.2 Lib 5.3 - Blinker 5.0 FW 2.0, Harbour 43.0 (Flex), xHarbour 99.1 99.2 99.3 (Simplex) FW 2.5 Quote Link to comment Share on other sites More sharing options...
personal Posted February 20, 2005 Report Share Posted February 20, 2005 Se entendi direito, o que voce quer é num campo caracter de x, quando digitar, pegar e retornar com o valor digitado e preencher com zeros a esquerda. _campo:=Space(05) @ l,c Get oCampo VAR _Campo Picture "@K 99999" OF oDlg Pixel Size 30,10 Valid vCampo() UPDATE Static Function vCampo() _Campo:=StrZero(Val(_despro),5) oDesPro:Refresh() Return(.t.) Oliveira, Sérgio A. PERSONAL - LINS MSN - sergio@personal.com.br SKYPE - sergio-personal FWH 2.5 / xHarbour 0.99.3 / brMake / no WS Quote Link to comment Share on other sites More sharing options...
bluesman Posted February 20, 2005 Report Share Posted February 20, 2005 irmao: dei uma olhada na classe e veja bem : so tem duas chamadas para transform, dai nem precisa mexer na classe : as chamadas sao : if bSetGet != nil * ::cCaption = If( cPict == nil, cValToChar( Eval( bSetGet ) ), ; * Transform( Eval( bSetGet ), cPict ) ) ::cCaption = Transform( Eval( bSetGet ), ::cPicture ) else ::cCaption = "" endif //----------------------------------------------------------------------------// METHOD SetPicture(ppp) CLASS TGet ::cPicture := ppp if ::bSetGet != nil * ::cCaption = If( cPict == nil, cValToChar( Eval( ::bSetGet ) ), ; * Transform( Eval( ::bSetGet ), cPict ) ) ::cCaption = Transform( Eval( ::bSetGet ), ::cPicture ) else ::cCaption = "" endif ::DispText() *::oGet:buffer = GetWindowText( ::hWnd ) return EU JA TIREI UMAS LINHAS LA MAS A DICA , ALIAS JA FIZ E FICA BALA É : function Bluestransform(sss,ppp) do case case "Z" $ ppp if valtype(sss) = "C" sss := strzero(val(sss),len(substr(ppp,at("9",alltrim(sss))),0) endif case "W" $ ppp // ideal para forcar minusculas ! nao tem no clipper! sss:= lower(sss) other sss := transform(sss,ppp) endcase return sss DAI VOCE TROCA NA CLASSE AS CHAMADAS DE TRANSORM POR BLUESTRANSFORM OK ? ABR FW1.92+Clipper 5.3+Lib+Blinker+BC++ Quote Link to comment Share on other sites More sharing options...
eajunior Posted February 21, 2005 Report Share Posted February 21, 2005 Ola Geraldo, estou mandando para o seu email a função que utilizo para devolver zeros a esquerda em um get. Se servir reporte. Acabou o carnaval então voltei (hehehehehe) Elias Abrão Júnior Fone : (0**11) 5181-6909 São Paulo - SP eajunior.fw@terra.com.br xHarbour 0.99.0 - Fivewin 2.5 e xMate Quote Link to comment Share on other sites More sharing options...
Kleyton Posted February 21, 2005 Report Share Posted February 21, 2005 eajunior, se não for pedir muito, se puder disponibilizar esta rotina em DICAS. Kleyton Clipper5.2E+Clipper5.3b+Blink7+FW2.0d cleitonbala@bol.com.br Quote Link to comment Share on other sites More sharing options...
eajunior Posted February 21, 2005 Report Share Posted February 21, 2005 Ola Kleyton, não em má vontade mas minhas funções costumam chamar outras funcoes internas, no caso da funções de zero a esquerda tive que fazer varias alterações pata mandar para o Geraldo, mas estou mandando para o seu email, caso funcione 100% me informe que coloco em dicas Acabou o carnaval então voltei (hehehehehe) Elias Abrão Júnior Fone : (0**11) 5181-6909 São Paulo - SP eajunior.fw@terra.com.br xHarbour 0.99.0 - Fivewin 2.5 e xMate Quote Link to comment Share on other sites More sharing options...
Kleyton Posted February 21, 2005 Report Share Posted February 21, 2005 Obrigado Elias. Não está faltando nenhuma LIB? Está dando o serro abaixo na compilação: BLINKER : 1115 : _EAJ1100.OBJ(_EAJ1100) : 'BLANK' : UNRESOLVED EXTERNAL Kleyton Clipper5.2E+Clipper5.3b+Blink7+FW2.0d cleitonbala@bol.com.br Quote Link to comment Share on other sites More sharing options...
marcelo Posted February 21, 2005 Report Share Posted February 21, 2005 Ola Geraldo Tente isso wnum=space(5) @ 1,2 get onum var wnum picture '@K@! of odlg valid zesq(wnum,5,odlg) FUNCTION Zesq(Wvar1,WTam,ODLG) Wvar1=TRIM(REPLICATE('0',Wtam-LEN(TRIM(Wvar1)))+Wvar1) WNUM:=WVAR1 ONUM:REFRESH() ODLG:UPDATE() RETURN(.T.) Quote Link to comment Share on other sites More sharing options...
dherly Posted January 30, 2008 Report Share Posted January 30, 2008 A mi me funciona asi (30-01-2008) @ 1,06 GET oGet Var xCod_pais OF oDlg Pict "@!@K 999" ; Valid(IF(s004->(DBSeek(PadL(AllTrim(xCod_pais),3,"0"))),; (Alert("C¢digo ya existe") ,.F. ),; (oGet:cText(PadL(AllTrim(xCod_pais),3,"0")) ,.T. ) ) ) ; When Tipo = "N" dherly@hotmail.com dherly@hotmail.com Quote Link to comment Share on other sites More sharing options...
elitenet Posted January 31, 2008 Report Share Posted January 31, 2008 Você pode fazer assim que irá funcionar: REDEFINE GET oDist1 Var pDist1 ID 31 OF oFld:aDialogs[2] PICTURE "9999" ; VALID(IIf(empty(pDist1),.T. ,; Eval({||oDist1:oGet:VarPut( strzero(val(pDist1),4) ), oDist1:Refresh(),.T.}))) UPDATE ; FONT oFont ; COLORS CLR_BLUE, CLR_WHITE Marcelo Gomes elitenet@terra.com.br (32) 3728-1288 Muriae - MG FW 2.3C/FWH 2.6/CLIPPER 5.X/XHARBOUR/C/C++/JAVA/DELPHI/XMATE/MD/MYSQL/FIREBIRD/INTERBASE 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.