Better and easier syntax for arrays: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
Line 13: Line 13:
<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][b]
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 -- same as a[2][2]=7</source>
{|-
{|-

Revision as of 18:42, 6 December 2019


Supported platforms:
Available since: Gideros 2017.11

Description


Operators to return the larger or smaller of two values.

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 -- same as a[2][2]=7

Methods

Events

Constants