Unpack: Difference between revisions

From GiderosMobile
Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Returns the elements from the given table. This function is equivalent to return list[i], list[..."
 
No edit summary
Line 8: Line 8:
  except that the above code can be written only for a fixed number of elements. By default, i is 1 and j is the length of the list, as defined by the length operator.
  except that the above code can be written only for a fixed number of elements. By default, i is 1 and j is the length of the list, as defined by the length operator.
<source lang="lua">
<source lang="lua">
(multiple), = unpack(list,)
(multiple) = unpack(list)
</source>
</source>
'''list:''' (table) table from which to extract elements ''''''<br/>
'''list''': (table) table from which to extract elements ''''''<br/>
'''Returns''' (multiple) all values from table as separate values<br/>
'''Returns''' (multiple) all values from table as separate values<br/>

Revision as of 09:17, 23 August 2018

Available since: Gideros 2011.6

Description

Returns the elements from the given table. This function is equivalent to

    return list[i], list[i+1], ···, list[j]
except that the above code can be written only for a fixed number of elements. By default, i is 1 and j is the length of the list, as defined by the length operator.
(multiple) = unpack(list)

'list: (table) table from which to extract elements '
Returns (multiple) all values from table as separate values