maudruidas Posted December 2, 2020 Report Share Posted December 2, 2020 Boa tarde, tenho um sistema antigo em modo console que está compilado com o Fivewin. No meu GET tenho um VADID que quando retorna .F. o campo numérico tem de ser apagado pelo cliente para poder ser digitado o novo número, ele não apaga automaticamente. Alguém saberia me dizer porque acontece isto?. ex: ao entrar foi digitato [ 23] . O sistema mostra "estoque insuficiente". Ao retornar [2 23]. Ao digitar o 2 ele não apaga o 23. Tenho de apagar 23 primeiro para depois digitar o 2. Se eu retornar .T. ele vai para o próximo campo, seu retornar para o campo anterior onde o estoque estava insuficiente ele funciona, ou seja todos os campos gets com valid que retornam .F. estão fazendo isto. Obrigado. Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted December 3, 2020 Report Share Posted December 3, 2020 Quando for .f. antes de retornar, zera a variável! Quote Link to comment Share on other sites More sharing options...
maudruidas Posted December 3, 2020 Author Report Share Posted December 3, 2020 Boa tarde, obrigado por responder. Já havia tentado fazer isto porém a varável do get não assume o valor zero (por exemplo), acho que por ainda estar dentro do mesmo get e em um valid. Veja como é meu programa @04,03 SAY "Vendedor........:" GET VEN PICT "999" VALID FUNVEN(VEN) // Busca o vendedor FUNCTION FUNVEN(XVEN) SAVE SCREEN TO TEL3 FALI := ALIAS() SELE 5 SET ORDER TO 1 SEEK STR(XVEN,3) IF EOF() MSG("Vendedor N„o Cadastrado, Tecle ENTER...") REST SCREEN FROM TEL3 SELE &FALI SET COLOR TO N/W RETURN(.F.) ENDIF SPA = 78-COL() @ROW(),COL() SAY SPACE(SPA) @ROW(),COL()-SPA+3 SAY ALLTRIM(NOME) SELE &FALI RETURN(.T.) Você diz para eu zerar a variável ven antes de retornar, correto? SELE &FALI SET COLOR TO N/W VEN := 0 RETURN(.F.) Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted December 3, 2020 Report Share Posted December 3, 2020 Provavelmente vc declarou como local e usou @ @04,03 SAY "Vendedor........:" GET VEN PICT "999" VALID FUNVEN(@VEN) // Busca o vendedor Tenta assim Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 3, 2020 Report Share Posted December 3, 2020 VEN := 0 VARPUT( VEN ) Quote Link to comment Share on other sites More sharing options...
aferra Posted December 3, 2020 Report Share Posted December 3, 2020 tente "@K9" Quote Link to comment Share on other sites More sharing options...
maudruidas Posted December 3, 2020 Author Report Share Posted December 3, 2020 Boa noite, o que eu percebi é que variável está aceitando o valor quando coloco zero, mas o GET não funciona mais de forma correta, o número anterior vai para a direita do campo e o novo valor quando digitado fica na esquerda e não apaga o da direita ao teclar o novo número. Vejam o vídeo que gravei demonstrando o que está acontecendo. Vejam se este link abre o vídeo https://1drv.ms/u/s!At7iPtV8NRXt2Cj3wL_flnMQaOFJ?e=OLOkEt Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 4, 2020 Report Share Posted December 4, 2020 9 horas atrás, maudruidas disse: @04,03 SAY "Vendedor........:" GET VEN PICTURE "@K 999" VALID FUNVEN(VEN) // Busca o vendedor Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 4, 2020 Report Share Posted December 4, 2020 Picture Codes Say Picture Functions B Display numbers left-justified ¦ X Display DB after negative numbers C Display CR after positive numbers ¦ Z Display zeros as blanks D Display date in SET DATE format ¦ ( Enclose negative numbers in parens E Display date in British format ¦ ! Convert alpha characters to upper R Insert non-template characters ¦ Say Picture Template Symbols A Display digits for any data type ¦ ! Convert alpha character to upper N " ¦ $ Display dollar sign instead of X " ¦ leading space in a numeric 9 " ¦ * Display asterisk instead of # " ¦ leading space in a numeric L Display logicals as "T" or "F" ¦ . Specify a decimal point position Y Display logicals as "Y" or "N" ¦ , Specify a comma position Get Picture Functions A C Allow only alpha characters B N Display numbers left-justified C N Display CR after positive numbers D D,N Display dates in SET DATE format E D,N Display dates with day and month inverted independent of the current DATE SETting, numerics with comma and period reverse K All Delete default text if first key is not a cursor key R C Insert non-template characters in the display but do not save in the Get variable S<n> C Allows horizontal scrolling within a Get. <n> is an integer that specifies the width of the region X N Display DB after negative numbers Z N Display zero as blanks ( N Display negative numbers in parentheses with leading spaces ) N Display negative numbers in parentheses without leading spaces ! C Convert alphabetic character to upper case Get Picture Template Symbols A Allow only alphabetic characters N Allow only alphabetic and numeric characters X Allow any character 9 Allow digits for any data type including sign for numerics # Allow digits, signs and spaces for any data type L Allow only T, F, Y or N Y Allow only Y or N ! Convert alphabetic character to upper case $ Display a dollar sign in place of a leading space in a numeric * Display an asterisk in place of a leading space in a numeric . Display a decimal point , Display a comma Quote Link to comment Share on other sites More sharing options...
maudruidas Posted December 4, 2020 Author Report Share Posted December 4, 2020 Bom dia, ainda não deu certo. Kapiaba eu já havia tentado o "@ 999", conforme o Aferra havia pedido. É muito estranho. Por enquanto eu agradeço pela ajuda, se alguém descobrir favor postar aqui, vou continuar pesquisando sobre o assunto. Quote Link to comment Share on other sites More sharing options...
ADutheil Posted December 4, 2020 Report Share Posted December 4, 2020 17 horas atrás, Jmsilva disse: Provavelmente vc declarou como local e usou @ @04,03 SAY "Vendedor........:" GET VEN PICT "999" VALID FUNVEN(@VEN) // Busca o vendedor Tenta assim Acho que Jmsilva já te passou a solução. FunVen( @Ven ). Verifique a presença do @ quando passa a variável. Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted December 5, 2020 Report Share Posted December 5, 2020 16 horas atrás, maudruidas disse: Bom dia, ainda não deu certo. Kapiaba eu já havia tentado o "@ 999", conforme o Aferra havia pedido. É muito estranho. Por enquanto eu agradeço pela ajuda, se alguém descobrir favor postar aqui, vou continuar pesquisando sobre o assunto. Se puder postar código da rotina ajuda! 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.