Pessoal
Gostaria de ajuda para converter caracter em numero:
Código: Selecionar todos
FUNCTION GERAINVENT( )
AARQ(74,.F.)
SELECT CADASTRO
ZAP //limpa o arquivo
*Index on PERIODO+DATA to (M->CAMINHO+"\"+M->CODIGO+"\LANCA1")
AARQ(73,.F.)
SELECT ARQIMP
*INDEX ON PERIODO+DATA TO ENTRADA1
*SET INDEX TO ENTRADA1
************************
Select ARQIMP
Goto top
Do while .not. eof()
*set Filter to PERIODO=M->REF_NUM
*If COD_PLANO<>0
WCODIGO=SUBSTR(CAMPO,1,6) // pega o código
WDESCRICAO=SUBSTR(CAMPO,7,40) // pega o nome
WQUANT=VAL(SUBSTR(CAMPO, 47,50)) // pega o endereço
WUNID=SUBSTR(CAMPO,55,60) // pega a cidade
WUNIT=SUBSTR(CAMPO,65,72) // pega a cidade
WTOTAL=SUBSTR(CAMPO,75,82) // pega a cidade
Select CADASTRO
*DBSEEK(WCODIGO)
APPEND BLANK
Replace cadastro->CODIGO with WCODIGO
Replace cadastro->DESCRICAO with WDESCRICAO
Replace cadastro->QUANT with WQUANT
Replace cadastro->UNID with WUNID
*Replace cadastro->UNIT with WUNIT
*Replace cadastro->TOTAL with WTOTAL
Select ARQIMP
SKIP
ENDDO
RETURN NIL
******** 


