[Gambas-user] help with inherits using serial port

T Lee Davidson t.lee.davidson at gmail.com
Wed Aug 1 18:22:07 CEST 2018


Or, if using Try, use "If Error Then" instead of Catch.
http://gambaswiki.org/wiki/lang/try

___
Lee


On 08/01/2018 12:06 PM, Tobias Boege wrote:
> The opening of the serial port may have failed. Your pringeneric.op()
> function has this:
> 
>   Try SComm.Open()
>   Catch
>     Print "error device" & Error.Text
> 
> Since you use Try, the error will be shadowed and you don't get error
> reporting via Catch, i.e. you won't know if opening failed. That's exactly
> what Try does: ignore errors. My normal user has no permissions to access
> /dev/ttyS0 and that error is ignored by your code, leading to another
> error later. It may be different on your system, but be sure to check it
> and remove the Try.


More information about the User mailing list