Top | Up (Array) | < Previous (PAGE NAME) | Next (PAGE NAME) >
Copies data between arrays or strings.
COPY dest_array[] [, dest_start%], source_array[] [[, source_start%], source_length%]
COPY dest_array[] [, dest_start%], source_label$ [, source_length%]
Parameter | Description |
---|---|
dest_array[] | The array/string to copy to |
dest_start% | The starting position in dest_array |
source_array[] | The array/string to copy from |
source_label$ | The DATA label to copy from |
source_start% | The position in source_array to start copying from |
source_length% | The number of items to copy |
dest_array
will be extended if there isn’t enough room for the data.
Copying between arrays:
DIM A[10]
DIM B[0]
COPY B,A 'copy data from A to B
?LEN(B) '10
Reading DATA into an array:
DIM A[3]
COPY A,@TEST
@TEST
DATA 10,20,30
Fixed crash when COPY was called without any arguments 1
COPY now allows the source length to be 0 2 3
1 SmileBoom “Fixes in Ver. 3.2.0 (June 17, 2015)” http://smilebasic.com/debug/archive/
2 SmileBoon “Bug Fixes in Ver. 3.5.2 (June 24, 2017)” http://smilebasic.com/en/debug/archive/
3 SquareFingers “Empty COPY source array gives error.” https://smilebasicsource.com/forum?ftid=1263
Top | Up (Array) | < Previous (PAGE NAME) | Next (PAGE NAME) >