[Gambas-user] gambas 0.60
Dimitri Bellini
dimitribellini at ...69...
Thu Jun 26 18:11:54 CEST 2003
HI Benoit
i have try this new function with new project i only cut and paste your post
but gambas return a syntax error on "OPEN "/dev/ttyS0" FOR READ WRITE WATCH
AS #hPort" i cant understand the problem.
Thanks for help
Dimitri
> - Files can be watched like Processes. Be careful, this implies a p-code
> incompatibility : older projects that use the OPEN keyword must be
> recompiled.
>
> Here is an example of how to watch a serial port :
>
> '-------------------------
> ' Gambas module
>
> PRIVATE hPort AS File
>
> PUBLIC SUB Main()
>
> OPEN "/dev/ttyS0" FOR READ WRITE WATCH AS #hPort
>
> END
>
> PUBLIC SUB File_Read()
>
> DIM iByte AS Byte
>
> PRINT "I can read at least one byte on the port"
> READ #hPort, iByte
> PRINT iByte
>
> END
>
> PUBLIC SUB File_Write()
>
> PRINT "I can write on the port"
> WRITE #hPort, 42
>
> END
>
> '-------------------------
>
> Enjoy it.
More information about the User
mailing list