[Lazarus] Serial communication??
mschnell at lumino.de
Wed Sep 29 14:41:28 CEST 2010
On 09/29/2010 01:26 PM, Mark Morgan Lloyd wrote:
> But the serial does allow you access to the handle, so it's trivial to
> use select() (actually fpSelect()) to implement the timeout.
Is spSelect() portable / Cross-Platform ?
If not I would not recommend using it other than encapsulated in a
portable unit that uses ifdefs to handle cross-platform issues.
> I'd comment at this point that some Windows programmers are
> excessively oriented towards events and messages (in my opinion) since
> that's about all that was available pre-NT.
IMHO: Object Pascal Events are not at all the same as Windows messages
(even though they often are implemented using Windows Messages in Delphi)
The beauty of Object Pascal is that it's based on an event driven
paradigm and thus in most cases prevents the user programmer from
complex stuff like thread communication, mutex, and select(). So IMHO
decent libraries should internally use whatever they want (threads,
Windows messages, select(), Mutex, Futex, signals, pipes, ...) but
should be compilable for all available platforms and provide a user
interface based on functions and Object Pascal Events that (if not
especially stated in the docs) are fired in the context of the main
thread. (I do like thread Events, but this is another issue and should
be dedicated to advanced programming.)
More information about the Lazarus