Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Latest commit

 

History

History
93 lines (79 loc) · 2.85 KB

COPY.org

File metadata and controls

93 lines (79 loc) · 2.85 KB

Top | Up (Array) | < Previous (PAGE NAME) | Next (PAGE NAME) >

COPY

Copies data between arrays or strings.

Syntax

COPY dest_array[] [, dest_start%], source_array[] [[, source_start%], source_length%]
COPY dest_array[] [, dest_start%], source_label$ [, source_length%]
ParameterDescription
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.

Examples

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

Version Information

3.2.0

Fixed crash when COPY was called without any arguments 1

3.5.2

COPY now allows the source length to be 0 2 3

References

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) >