[Gambas-user] using try when access devices shadow the errors

T Lee Davidson t.lee.davidson at gmail.com
Thu Aug 2 17:13:07 CEST 2018


"there's no such information on the wiki"

Incorrect. The information IS there.

The documentation page for TRY (http://gambaswiki.org/wiki/lang/try) makes no mention whatsoever of any need to use the CATCH
instruction. You paired CATCH with TRY without any documented reason to do so. Don't blame the Wiki.

The doc page for CATCH (http://gambaswiki.org/wiki/lang/catch) specifically states, in the very first sentence, that, "This
instruction indicates the beginning of the error management part of a function or a procedure." Therefore, CATCH, not TRY, opens
an exception handling block. The immediate effect of TRY is limited in scope to a single statement or instruction.

___
Lee


On 08/02/2018 10:57 AM, PICCORO McKAY Lenz wrote:
> 2018-08-02 10:32 GMT-04:00 T Lee Davidson <t.lee.davidson at gmail.com <mailto:t.lee.davidson at gmail.com>>:
> 
>     There is no such thing as a "try-catch" in Gambas. CATCH is *not* used with TRY.
>     Tobi gave a good example:
> 
> i see it and that's why i point "there's no such information on the wiki"
>  
> 
>     Yes! CATCH is *not* used with TRY. TRY does not open an exception handling block as with other languages (eg. Python's
>     "try-except"). It is a statement that affects the behavior of only the *line* which it begins.
> 
>     When using TRY, you test for an error condition with the ERROR keyword. If you do not, then the error is not revealed, and the
>     program would continue merrily along under a potentially false assumption. If you want to use CATCH, then do not use TRY.
> 
> well i comming from java and C and its common ofr us use try/cacht as duple
> 
> anyway! there's not similar info in the wiki that produces a waste of time for novices !
>  
> 
> 
> 
>     ___
>     Lee
> 
>     ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 
> 
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 


More information about the User mailing list