Page 1 of 1

Syntax of multiple variable assignments

Posted: Thu Sep 15, 2022 11:06 am
by Flinx
I just made a mistake because I had not yet fully grasped the syntax of multiple variable assignments. I had

Code: Select all

Local a, b
and added an assignment

Code: Select all

Local a, b=1
and overlooked the fact that the 1 is then assigned to a.
Perhaps a warning would help if fewer values are assigned than variables are listed.

Ralf

Re: Syntax of multiple variable assignments

Posted: Sun Sep 18, 2022 11:22 am
by airsoftsoftwair
Flinx wrote: Thu Sep 15, 2022 11:06 am Perhaps a warning would help if fewer values are assigned than variables are listed.
That wouldn't make sense because variables are often declared without being initialized so this would trigger a lot of false positive warnings.