[Gambas-user] help with inherits using serial port

Jussi Lahtinen jussi.lahtinen at gmail.com
Thu Aug 2 20:43:49 CEST 2018


You did not understand the answer Lee gave to you. It does use the event,
it's File_Read. In your case the read event is SComm_Read, because you
named so.
Very basics of events.


Jussi

On Thu, Aug 2, 2018 at 7:07 PM, PICCORO McKAY Lenz <mckaygerhard at gmail.com>
wrote:

> umm if you opend the attached i send in first mail noted that i do as you
> cited with file example, so then seems i not explained very well, i taking
> about tobias said : "declare the event name "SComm" but  don't use it at
> all"
>
> so if your example citation does not use the event name so what it's the
> point, i taking about usage of event name!
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2018-08-02 11:25 GMT-04:00 T Lee Davidson <t.lee.davidson at gmail.com>:
>
>> 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
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>
>
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180802/6765a681/attachment.html>


More information about the User mailing list