hi all,
i have a (small?) problem concerning the serial com ports.
this problem was already mentioned once by somebody else in the following post: http://www.powerbasic.com/support/pb...ead.php?t=1691
but no replies...
thing is that the comm(#hcomm, txbuffer) statement returns 0 as the
txbuffer length although it has been set to a certain value before.
i tried the "c:\pbdll60\samples\comm\comm.bas" example.
this works fine until you try to send a file. then comm.bas tries
to retrieve the txbuffer length using comm(#hcomm, txbuffer).
this statement returns 0 as a value. this causes a program crash later
on in the program because of a division by zero error.
you can try it in the sample program on your drive by adding 1 line to
the following routine:
on my windows 2000 pc the messagebox shows a returned value of 0...
does anybody have any suggestion?
kind regards
eddy
------------------
[email protected]
[this message has been edited by eddy van esch (edited june 12, 2001).]
i have a (small?) problem concerning the serial com ports.
this problem was already mentioned once by somebody else in the following post: http://www.powerbasic.com/support/pb...ead.php?t=1691
but no replies...
thing is that the comm(#hcomm, txbuffer) statement returns 0 as the
txbuffer length although it has been set to a certain value before.
i tried the "c:\pbdll60\samples\comm\comm.bas" example.
this works fine until you try to send a file. then comm.bas tries
to retrieve the txbuffer length using comm(#hcomm, txbuffer).
this statement returns 0 as a value. this causes a program crash later
on in the program because of a division by zero error.
you can try it in the sample program on your drive by adding 1 line to
the following routine:
Code:
function startcomms as long comm open $comport as #hcomm if errclear then exit function ' exit if port cannot be opened comm set #hcomm, baud = 9600 'baud comm set #hcomm, byte = 8 ' 8 bits comm set #hcomm, parity = %true ' parity comm set #hcomm, paritytype = 2 '0 = none, 1 = odd, 2 = even, 3 = mark, 4 = space comm set #hcomm, stop = 2 ' 2 stop bit comm set #hcomm, txbuffer = 4096 ' 4k transmit buffer comm set #hcomm, rxbuffer = 4096 ' 4k receive buffer 'add the following line to display buffer size: msgbox str$(comm(#hcomm, txbuffer)),,"read size of txbuffer" function = %true end function
does anybody have any suggestion?
kind regards
eddy
------------------
[email protected]
[this message has been edited by eddy van esch (edited june 12, 2001).]
Comment