Preciso de uma funcao em xharbour que faça a mesma coisa que a funcao em clipper esta fazendo.
Segue a funcao em clipper:
Código: Selecionar todos
*******************
Function Ler_Peso()
*******************
Local nPorta := 1
Local cTrans := "N"
Local nBits := 8
Local nParad := 1
Local nVeloc := 2400
Local cInicia:= Chr(05)
Local Erro := .F.
Local VlrPeso:= 0
Local nRetorn:= .T.
If Com_Open(nPorta,1000,1000) == .t.
nConf := Com_Init(nPorta,nVeloc,cTrans,nBits,nParad)
Com_Send(nPorta,cInicia)
Inkey(0.10)
Com_Count(nPorta)
Inkey(0.10)
nLeitura := Com_read(nPorta,10)
If Substr(nLeitura,1,1)== Chr(02) .And. Right(AllTrim(nLeitura),1)==Chr(03)
alert(nleitura)
Endif
Com_Close(nPorta)
Endif
Return (.T.)
