[Gambas-user] help with inherits using serial port
T Lee Davidson
t.lee.davidson at gmail.com
Thu Aug 2 17:25:38 CEST 2018
On 08/01/2018 01:21 PM, PICCORO McKAY Lenz wrote:
> next issue that I can spot is that you declare the event name "SComm" but
> don't use it at all to intercept events. No wonder you don't get any.
>
> *please that parti, i need more clear ideas of them, but the english language are a barrier
> *
> *a kind of more "example for dummies" can be in that point?*
There is a simple example at http://gambaswiki.org/wiki/lang/open:
[code]
' Watching a serial port
Dim hFile As File
hFile = Open "/dev/ttyS0" For Read Write Watch
...
Public Sub File_Read()
Dim iByte As Byte
Read #hFile, iByte
Print "Got one byte: "; iByte
End
[/code]
It does not give the hFile object a custom name as you do with: SComm = New SerialPort As "SComm"
So, event management uses "File" as its name, and its Read event is handled with the File_Read() subroutine.
See also: http://gambaswiki.org/wiki/lang/eventdecl
___
Lee
More information about the User
mailing list