[Gambas-user] Confusing feature

Benoît Minisini g4mba5 at gmail.com
Mon Aug 24 17:02:08 CEST 2020


Le 24/08/2020 à 03:35, Jussi Lahtinen a écrit :
> See the attached project.
> 
> Jussi
> 

This is normal.

When using "Inc Expr", Expr is evaluated twice, except the part that is 
used for storing the result.

So "Inc A[Rand(0, 9)]" is equivalent to:

A[Rand(0,9)] = A[Rand(0, 9]] + 1

Same thing for "A[Rand(0, 9)] += 1".

Beware to syntactic sugar!

Regards,

-- 
Benoît Minisini


More information about the User mailing list