On Mon, 04 Oct 2010 11:04:48 +0100, Paulo Costa <[email protected]> wrote:
>On 04/10/2010 07:17, Bo Berglund wrote: > >> Thanks for the suggestion! I have now installed the serial component >> of the suite on my Ubuntu Lazarus. >> As indicated there is an event for receiving the incoming data even >> though that event does not tell how many characters are actually >> available. So how do I know how many I can read in from the port? > >You don't need to know. When you are in the OnRxData event if you call >ReadData(): > >procedure TForm1.SdpoSerial1RxData(Sender: TObject); >var mess: string; >begin > mess := SdpoSerial1.ReadData(); > ... >end; > >It will return a string with all available bytes in the input buffer. Thanks, that explains it enough that I can move on! .-) >> Should there not be an exception raised if the wanted port does not >> exist? > >Yes. There is an exception that is raised when the open() call fails. It looks like my virtual Ubuntu 10 thinks it has a serial port even though none has been created by VMWare Workstation. Here is no exception when I try to open it.... Bo Berglund -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
