Difference between revisions of "Better and easier syntax for arrays"
From GiderosMobile
(changed the description as it was inapropriate? plus some formatting and added more to code desciption) |
|||
Line 5: | Line 5: | ||
'''<translate>Available since</translate>:''' Gideros 2017.11<br/> | '''<translate>Available since</translate>:''' Gideros 2017.11<br/> | ||
=== <translate>Description</translate> === | === <translate>Description</translate> === | ||
− | <translate> | + | <translate>a=b[c<b> , </b>d]   The same as 'a=b[c][d]' but shorter and easier to understand and read.</translate> |
− | |||
− | |||
− | a=b[c<b> , </b>d]   The same as 'a=b[c][d]' but shorter and easier to understand and read. | ||
=== <translate>Examples</translate> === | === <translate>Examples</translate> === | ||
− | '''Simple examples''' | + | '''Simple examples:''' |
− | <source lang="lua"> | + | <source lang="lua"> |
a={{1,2,3},{4,5,6},{7,8,9}} | a={{1,2,3},{4,5,6},{7,8,9}} | ||
b=a[2,2] -- b will be 5, easier to read than b=a[2][2] | b=a[2,2] -- b will be 5, easier to read than b=a[2][2] | ||
− | a[2,2]=7 -- same as a[2][2]=7</source> | + | a[2,2]=7 -- change value of a[2,2] to 7, same as a[2][2]=7 |
+ | </source> | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| |
Revision as of 07:03, 17 December 2019
Supported platforms:
Available since: Gideros 2017.11
Description
a=b[c , d] The same as 'a=b[c][d]' but shorter and easier to understand and read.
Examples
Simple examples:
a={{1,2,3},{4,5,6},{7,8,9}}
b=a[2,2] -- b will be 5, easier to read than b=a[2][2]
a[2,2]=7 -- change value of a[2,2] to 7, same as a[2][2]=7
Methods |
EventsConstants |