Dbedit
Enviado: 19 Nov 2007 15:26
Pessoal,
converti o meu sistema mas estou esbarrando no dbedit.
Ele até abre o dbedit mas fica duplicando os caracteres quando teclo quaquer letra para iniciar a pesquisa.
Estou dependendo só disso para terminar a implantação.
Ajudem-me por favor
go top
private campos[1], mascara[1], nomes[1]
campos[1] = 'str(codigo,3)+" "+descr+" "+subst(SE->descricao,1,10)+" "+tipo+" "+str(nivel,1)+" "+str (nivel2,1)+" "+acompanha+" "+str(qtde,5)+" "+strtran(str(valor,7,2),".",",",)'
mascara[1] = '@!X'
nomes[1] = 'COD DESCRICAO SETOR T NIV A QUANT VALOR'
n1 := 3
n2 := 1
n3 := 22
n4 := 78
xdig = ""
Message("¦ [F2] CODIGO ¦ [ENTER] CONSULTA ¦",corm1)
set color to w+/b
dbedit(n1,n2,n3,n4,campos,'ordem4',mascara,nomes,,,,)
set color to
close data
return
Function Ordem4
parameters modo
rr = row()
Save screen to lptela
set cursor off
RestScreen(Row(),n2,Row(),n4,Transform(SaveScreen(Row(),n2,Row(),n4),repl("X"+Chr(112),2*n4)))
Inkey(0)
set color to w+/r
keyBoard Chr(LastKey())
do case
case LastKey()>64 .and. LastKey()<91 .or. LastKey()>96 .and. LastKey()<123;
.or. LastKey()=32 .or. lastkey()=128 .or. lastkey()=199;
.or. lastkey()>44 .and. lastkey()<58
Clear TypeAhead
set order to 2
xdig = xdig + upper(chr(lastkey()))
seek xdig
@ 1,1 say xdig color "w+/r"
return(2)
case lastkey()=5 .or. lastkey()=24 .or. lastkey()=31 .or. lastkey() = 30
xdig:= ""
@ 1,1 say repl(" ",15) color "w"
return(2)
case lastkey() = 8
xdig := subst(xdig, 1, len(xdig) - 1)
@ 1,1 say repl("Ä",15) color "w"
@ 1,1 say xdig color "w+/b"
return(2)
case lastkey() = -1
Clear TypeAhead
set order to 1
set cursor on
xcof := 0
@ 5,6 get xcof pict '999' color "w+/r"
read
set cursor off
if xcof = 0
go top
else
set softseek on
seek str(xcof,4)
set softseek off
if eof()
message("º CODIGO NAO ENCONTRADO! º",corm2,1.5)
restore screen from lptela
return(2)
endif
endif
restore screen from lptela
return(2)
case lastkey() = 13
clear typeahead
set color to
xrot := "C"
Proinclu()
set color to w+/b
restore screen from lptela
return(2)
case lastkey() = 27
Clear TypeAhead
return(0)
other
return(1)
endcase
return
converti o meu sistema mas estou esbarrando no dbedit.
Ele até abre o dbedit mas fica duplicando os caracteres quando teclo quaquer letra para iniciar a pesquisa.
Estou dependendo só disso para terminar a implantação.
Ajudem-me por favor
go top
private campos[1], mascara[1], nomes[1]
campos[1] = 'str(codigo,3)+" "+descr+" "+subst(SE->descricao,1,10)+" "+tipo+" "+str(nivel,1)+" "+str (nivel2,1)+" "+acompanha+" "+str(qtde,5)+" "+strtran(str(valor,7,2),".",",",)'
mascara[1] = '@!X'
nomes[1] = 'COD DESCRICAO SETOR T NIV A QUANT VALOR'
n1 := 3
n2 := 1
n3 := 22
n4 := 78
xdig = ""
Message("¦ [F2] CODIGO ¦ [ENTER] CONSULTA ¦",corm1)
set color to w+/b
dbedit(n1,n2,n3,n4,campos,'ordem4',mascara,nomes,,,,)
set color to
close data
return
Function Ordem4
parameters modo
rr = row()
Save screen to lptela
set cursor off
RestScreen(Row(),n2,Row(),n4,Transform(SaveScreen(Row(),n2,Row(),n4),repl("X"+Chr(112),2*n4)))
Inkey(0)
set color to w+/r
keyBoard Chr(LastKey())
do case
case LastKey()>64 .and. LastKey()<91 .or. LastKey()>96 .and. LastKey()<123;
.or. LastKey()=32 .or. lastkey()=128 .or. lastkey()=199;
.or. lastkey()>44 .and. lastkey()<58
Clear TypeAhead
set order to 2
xdig = xdig + upper(chr(lastkey()))
seek xdig
@ 1,1 say xdig color "w+/r"
return(2)
case lastkey()=5 .or. lastkey()=24 .or. lastkey()=31 .or. lastkey() = 30
xdig:= ""
@ 1,1 say repl(" ",15) color "w"
return(2)
case lastkey() = 8
xdig := subst(xdig, 1, len(xdig) - 1)
@ 1,1 say repl("Ä",15) color "w"
@ 1,1 say xdig color "w+/b"
return(2)
case lastkey() = -1
Clear TypeAhead
set order to 1
set cursor on
xcof := 0
@ 5,6 get xcof pict '999' color "w+/r"
read
set cursor off
if xcof = 0
go top
else
set softseek on
seek str(xcof,4)
set softseek off
if eof()
message("º CODIGO NAO ENCONTRADO! º",corm2,1.5)
restore screen from lptela
return(2)
endif
endif
restore screen from lptela
return(2)
case lastkey() = 13
clear typeahead
set color to
xrot := "C"
Proinclu()
set color to w+/b
restore screen from lptela
return(2)
case lastkey() = 27
Clear TypeAhead
return(0)
other
return(1)
endcase
return