Difference between revisions of "Table.move"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 7: Line 7:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
(table) = table.move(src,a,b,t,dst)
 
(table) = table.move(src,a,b,t,dst)
</source>
+
</syntaxhighlight>
  
 
  '''The default for dst is src. The destination range may overlap with the source range'''
 
  '''The default for dst is src. The destination range may overlap with the source range'''

Latest revision as of 14:33, 13 July 2023

Available since: Gideros 2022.3
Class: table

Description

Copies elements from table src into table dst. Is equivalent to the multiple assignment statement: dst[t], ... = src[a], ..., src[b].

(table) = table.move(src,a,b,t,dst)
The default for dst is src. The destination range may overlap with the source range
Returns dst for convenience

Parameters

src: (table) the source table
a: (number) start copying at src[a]
b: (number) copy up to and including src[b]
t: (number) copy into dst[t], ....
dst: (table) destination table optional, default value: "src"

Return values

Returns (table) dst, for convenience