Mário,
A versão que tenho aqui sempre usei com xHarbour + gtwvw + hwgui e nunca
tive esse problema...
Como faço para listar as funçíµes que estão na lib?
Será que essas funçíµes são de uma outra lib do xharbour?
Obrigado pela atenção,
Reginaldo
"Mário Angelini" <mario[at]emeasoft[dot]com[dot]br> escreveu na notícia da
mensagem:4dc99e6d$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Reginaldo:
> HBCOMM.LIB não tem estas funçíµes.
>
> Function Information:
> Nx_port, Nbaud, Ndata, Nparity, Nstop, nBufferSize
> Init_Port( cPort, nBaudrate, nDatabits, nParity, nStopbits,
> nBuffersize ) -->
> nHandle
>
> Port opener and initializer.
>
> Where:
>
> cPort Port designator. Can either be old form 'COMn' or the
> more
> general form '.COMn'. The general form is required for
> ports higher than COM9.
>
> nBaudrate Just like you're used to (e.g., 2400, 4800, 9600,
> etc. )
>
> nDatabits Usually 8, but can be 7 or 4.
>
> nParity coded: 0,1,2,3 -> none, odd, mark, even
>
> nStopbits coded: 0,1,2 -> 1, 1.5, 2
>
> nBuffersize I'm using 8000 at 38,400 baud.
>
> nHandle returned instance identifier. A numeric >= 256. If
> nHandle
> is negative, the open failed.
>
> OutBufClr( nHandle ) --> lSuccess
>
> Clear the output buffer. lSuccess will always be TRUE unless
> a bad
> nHandle is used.
>
> IsWorking( nHandle ) --> lSuccess
>
> Check to see if port is operative. Failures can occur if a
> bad nHandle
> is used or if remote party drops the line.
>
> InChr( nHandle, nChar, @cBuff ) --> nBytesRead
>
> Fetch data from the input buffer. Note the by reference
> argument
> passing
> for the buffer. nChar can be determined by calling
> InBufSize().
> nBytesRead is the actual number of bytes loaded into cBuff
> (usually
> equal to nChar unless there is a problem or nChar is
> overstated.)
>
> InBufSize( nHandle ) --> nNumberofBytesInInputBuffer
>
> Get the count of bytes waiting in the input buffer. Usually
> followed
> by
> a call to Inchr to fetch the bytes for processing.
>
> OutChr( nHandle, cBytesToWrite, nCount ) --> lSuccess
>
> Write the first nCount bytes from the string cBytesToWrite.
> Usually,
> nCount == Len( cBytesToWrite ).
>
> OutBufSize( nHandle ) --> nBytesInOutputBuffer
>
> Get the byte count of characters awaiting transmission.
>
> UnInt_Port( nHandle ) --> lSuccess
>
> Uninitialize (Close) the port and free the handle.
>
> SETHANDSHAKE(nhandle,nShake) ->lSet
> Set the handshake to com port
> values of nshake can be
> EHandshakeUnknown = -1, // Unknown
> EHandshakeOff = 0, // No handshaking
> EHandshakeHardware = 1, // Hardware handshaking (RTS/CTS)
> EHandshakeSoftware = 2, // Software handshaking (XON/XOFF)
> EHANDSHAKEHARDWAREDTR = 3, // Hardware handshaking DTR
> On/RTS
> off
> EHANDSHAKEHARDWARERTS = 4 // Hardware handshaking DTR
> Off/RTS
> on
>
>
> ISCTS(handle) ->lCts
> verify if cts event occured
> USAGE:
>
> Here's how I do this stuff...
>
> STATIC nHandle
>
> ...Mainline...
>
>
> IF OpenOk()
>
> DOProcessing()
>
> ELSE
>
> MsgStop( 'Cannot open port!' )
>
> QUIT
>
> ENDIF
>
> Function OpenOk()
>
> // Open the port
>
> IF ( nHandle := Init_Port( 'COM1', 9600, 8, 0, 0, 8000 ) ) >
> 0
>
> OutBufClr( nHandle ) // Saw this somewhere...probably ok if
> unnecessary
>
> Return IsWorking()
>
> ENDIF
>
> Return FALSE
>
> Function DOProcessing()
>
> ...
>
> // Get a chunk from the COM port
>
> nChr := InBuffSize( nHandle )
> cBuff := Space( nHandle )
>
> IF nChr != InChr( nHandle, nChr, @cBuff)
>
> MsgStop( 'Some kind of read failure on COM Port.' )
>
> Return FALSE
>
> ENDIF
>
> // process data in cBuff
>
> // write some stuff to port
>
> IF ! OutChr( nHandle, cSomeStuff, Len( cSomeStuff ) )
>
> MsgStop( 'Write error on COM Port.' )
>
> Return FALSE
>
> ENDIF
>
> // ...etc
>
> // and finally, when night is nigh...
>
> // Close the port
>
> UnInt_Port( nHandle )
>
> Return NIL
>
> --
> Saludos!
> Mário Angelini
>
http://www.eMeAsOfT.com
>
http://emeasoft.blogspot.com/
>
http://twitter.com/emeasoft
>
>
http://bit.ly/ci22sm
>
http://www.brasilturismo.com/brasil/