[↑]
SmileBASIC4 Replica Reference
COPY
1. Copy an array

COPY(CopySourceArray[,CopySourceOffset[,NumberOfCopyElements]])

Arguments

CopySourceArray

Copy source array

・Only 1D arrays can be specified.

CopySourceOffset

First element number of copy source

・If not specified, it's 0.

NumberOfCopyElements

Number of elements to copy

・If not specified, the number of elements in the copy source array minus the copy source offset is specified.

Return Value

Copy result array

・In the case of string array, the string of each element is also copied.

2. Copy the string

COPY(CopySourceString[,CopySourceOffset[,NumberOfCopyCharacters]])

Arguments

CopySourceString

Copy source string

CopySourceOffset

Copy source start position

・If not specified, it's 0.

NumberOfCopyCharacters

Number of characters to copy

・If not specified, the number of characters in the copy source string minus the copy source offset is specified.

Return Value

Copy result string

3. Copy the contents of an array to another array

COPY CopyDestinationArray[,CopyDestinationOffset],CopySourceArray[[,CopySourceOffset],NumberOfCopyElements]

・For 1D arrays only, if the copy destination array has fewer elements than the copy source array, it is automatically expanded.
・The dimensions of the array are ignored for both the copy source and the copy destination.

Arguments

CopyDestinationArray

Copy destination array

CopyDestinationOffset

First element number of the copy destination

・If not specified, it's 0.

CopySourceArray

Copy source array

CopySourceOffset

First element number of copy source

・If not specified, it's 0.

NumberOfCopyElements

Number of elements to copy

・If not specified, the number of elements in the copy source array minus the copy source offset is specified.

Example

DIM SRC[10],DST[10]
COPY DST,SRC
4. Read DATA column into array

COPY CopyDestinationArray[,CopyDestinationOffset],LabelString[,NumberOfCopyData]

・Read the data defined by the DATA statement into the array.
・If the number of array elements is less than the number of copy data, only 1D arrays are automatically expanded if the number of elements in the copy destination array is insufficient.

Arguments

CopyDestinationArray

Copy destination array

CopyDestinationOffset

First element number of the copy destination

・If not specified, it's 0.

LabelString

Label name string indicating the DATA statement you want to read

・Reading starts from the DATA statement that appears first after the label name.

NumberOfCopyData

Number of data to be read

・An error occurs if the number of data that can be read is less than the value specified here.
・If not specified, the number of elements in the copy destination array is specified.

Example

DIM DST[5]
COPY DST,"@SRC" 
@SRC
DATA 5,1,1,2,4
5. Copy part or all of a string to another string variable

COPY CopyDestinationStringVariable[,CopyDestinationOffset],CopySourceString[[,CopySourceOffset],NumberOfCopyCharacters]

Arguments

CopyDestinationStringVariable

Copy destination string variable

CopyDestinationOffset

Copy start position

・If not specified, it's 0.

CopySourceString

Copy source string

CopySourceOffset

Copy source start position

・If not specified, it's 0.

NumberOfCopyCharacters

Number of characters to copy

・If not specified, the number of characters in the copy source string minus the copy source offset is specified.

Example

COPY A$,"12345" 
About this site
Our site is an unofficial manual site of programming software "SmileBASIC" for NintendoSwitch™.
I acquire the content of the site from the official reference site of the SmileBoom Co.Ltd. that is the development and sales cause of the software in real time (a minimum period of 24 hours update) and display it. For automatic update, contents may become improper.
Please confirm the correct content in an official site.

June 3, 2020
by mim
OK
|