Ai vai a funcao
Enviado: 08 Nov 2004 09:00
Ola Galera!!!!
Eu uso o exospace por causa da memoria alta, mas com o Blinker Trava tambem, pode o 5.2 ou 5.3
t+
#include "common.ch"
#include "inkey.ch"
* funcao das vendas *
*********************************************************
FUNC LETRAORCA()
LOCAL ar_dbf:=ALIAS(), nCol:=20, nKey, v_tel_p, cor_ant:=SETCOLOR()
v_tel_p:=SAVESCREEN(0,0,MAXROW(),79)
nVar="0000"
IF !EMPTY(ar_dbf) // sava situacao atual
ultreg =RECNO() // registro e
ord_ind=INDEXORD() // indice utilizado
ENDI
******select 1
set order to 1
GO TOP
KEYBOARD CHR(27)
aColunas:={'Nome','Labora','Venda','Estoque','Desconto'}
******SETCOLOR("W/B")
box3df2(05,19,03,76)
******@ 03, 02, 21, 78 BOX "ÚÄ¿³ÙÄÀ³ "
*******@ 05,03 SAY REPLIC('Ä',75)
DBEDIT(6,5,18,75,aColunas)
@ 20, 15 SAY ""
@ 20, 15 SAY SPAC(73) COLOR "N/W"
nCol=20
@ 20, 15 SAY "" COLOR "N/W"
cNome=SPAC(00)
DO WHILE .T.
IF LASTKEY()=13
IF !EMPTY(ar_dbf)
SELE (ar_dbf)
DBSETORDER(ord_ind)
GO ultreg
ENDI
SETCOLOR(cor_ant)
RESTSCREEN(0,0,MAXROW(),79,v_tel_p)
KEYBOARD nVar
RETURN (.t.)
ELSE
nKey=INKEY(0)
IF nKey=27
EXIT
ENDIF
IF nKey=13
IF !EMPTY(ar_dbf)
SELE (ar_dbf)
DBSETORDER(ord_ind)
GO ultreg
ENDI
SETCOLOR(cor_ant)
RESTSCREEN(0,0,MAXROW(),79,v_tel_p)
KEYBOARD nVar
RETURN (.t.)
ENDIF
ENDIF
IF nKey=8 .or. nKey=19
nCol=nCol-1
IF nCol < 20
nCol=20
ENDIF
cNome=SUBS(cNome,1,LEN(cNome)-1)
@ 20, 15 SAY cNome+" " COLOR "N/W"
ELSEIF (nKey>=32 .and. nKey<=165)
nCol=nCol+1
IF nCol>=50
nCol=50
cNome=SUBS(cNome,1,LEN(cNome)-1)
ENDIF
cNome=UPPER(cNome+CHR(nKey))
@ 20,15 SAY cNome COLOR "N/W"
ENDIF
IF !PESQ_ORCA(cNome)
nCol=nCol - 1
IF nCol <20
nCol=20
ENDIF
cNome=SUBS(cNome,1,LEN(cNome)-1)
@ 20,15 SAY cNome COLOR "N/W"
ENDIF
@ 20,15 SAY cNome COLOR "N/W"
ENDDO
IF !EMPTY(ar_dbf)
SELE (ar_dbf)
DBSETORDER(ord_ind)
GO ultreg
ENDI
SETCOLOR(cor_ant)
RESTSCREEN(0,0,MAXROW(),79,v_tel_p)
RETURN
FUNC PESQ_ORCA(cNome)
IF DBSEEK(cNome,.T.)
nVar=CODIGO
IF LASTKEY() <> 5 .AND. LASTKEY() <> 24
KEYBOARD CHR(27)
ENDIF
DBEDIT(6,05,18,75,aColunas,"CONTROLE2")
ELSE
RETURN (.F.)
ENDIF
RETURN (.T.)
FUNC CONTROLE2(nMod)
IF nMod=4
IF LASTKEY()=13
nVar=CODIGO
RETURN(0)
ELSE
RETURN(0)
ENDIF
ENDIF
RETURN(1)
Eu uso o exospace por causa da memoria alta, mas com o Blinker Trava tambem, pode o 5.2 ou 5.3
t+
#include "common.ch"
#include "inkey.ch"
* funcao das vendas *
*********************************************************
FUNC LETRAORCA()
LOCAL ar_dbf:=ALIAS(), nCol:=20, nKey, v_tel_p, cor_ant:=SETCOLOR()
v_tel_p:=SAVESCREEN(0,0,MAXROW(),79)
nVar="0000"
IF !EMPTY(ar_dbf) // sava situacao atual
ultreg =RECNO() // registro e
ord_ind=INDEXORD() // indice utilizado
ENDI
******select 1
set order to 1
GO TOP
KEYBOARD CHR(27)
aColunas:={'Nome','Labora','Venda','Estoque','Desconto'}
******SETCOLOR("W/B")
box3df2(05,19,03,76)
******@ 03, 02, 21, 78 BOX "ÚÄ¿³ÙÄÀ³ "
*******@ 05,03 SAY REPLIC('Ä',75)
DBEDIT(6,5,18,75,aColunas)
@ 20, 15 SAY ""
@ 20, 15 SAY SPAC(73) COLOR "N/W"
nCol=20
@ 20, 15 SAY "" COLOR "N/W"
cNome=SPAC(00)
DO WHILE .T.
IF LASTKEY()=13
IF !EMPTY(ar_dbf)
SELE (ar_dbf)
DBSETORDER(ord_ind)
GO ultreg
ENDI
SETCOLOR(cor_ant)
RESTSCREEN(0,0,MAXROW(),79,v_tel_p)
KEYBOARD nVar
RETURN (.t.)
ELSE
nKey=INKEY(0)
IF nKey=27
EXIT
ENDIF
IF nKey=13
IF !EMPTY(ar_dbf)
SELE (ar_dbf)
DBSETORDER(ord_ind)
GO ultreg
ENDI
SETCOLOR(cor_ant)
RESTSCREEN(0,0,MAXROW(),79,v_tel_p)
KEYBOARD nVar
RETURN (.t.)
ENDIF
ENDIF
IF nKey=8 .or. nKey=19
nCol=nCol-1
IF nCol < 20
nCol=20
ENDIF
cNome=SUBS(cNome,1,LEN(cNome)-1)
@ 20, 15 SAY cNome+" " COLOR "N/W"
ELSEIF (nKey>=32 .and. nKey<=165)
nCol=nCol+1
IF nCol>=50
nCol=50
cNome=SUBS(cNome,1,LEN(cNome)-1)
ENDIF
cNome=UPPER(cNome+CHR(nKey))
@ 20,15 SAY cNome COLOR "N/W"
ENDIF
IF !PESQ_ORCA(cNome)
nCol=nCol - 1
IF nCol <20
nCol=20
ENDIF
cNome=SUBS(cNome,1,LEN(cNome)-1)
@ 20,15 SAY cNome COLOR "N/W"
ENDIF
@ 20,15 SAY cNome COLOR "N/W"
ENDDO
IF !EMPTY(ar_dbf)
SELE (ar_dbf)
DBSETORDER(ord_ind)
GO ultreg
ENDI
SETCOLOR(cor_ant)
RESTSCREEN(0,0,MAXROW(),79,v_tel_p)
RETURN
FUNC PESQ_ORCA(cNome)
IF DBSEEK(cNome,.T.)
nVar=CODIGO
IF LASTKEY() <> 5 .AND. LASTKEY() <> 24
KEYBOARD CHR(27)
ENDIF
DBEDIT(6,05,18,75,aColunas,"CONTROLE2")
ELSE
RETURN (.F.)
ENDIF
RETURN (.T.)
FUNC CONTROLE2(nMod)
IF nMod=4
IF LASTKEY()=13
nVar=CODIGO
RETURN(0)
ELSE
RETURN(0)
ENDIF
ENDIF
RETURN(1)