[↑]
SmileBASIC4 Replica Reference
FIND
1. Search an array for a specified value and return the found position

FIND(Array,Value)

Arguments

Array

Target array to search

・Multi-dimensional arrays can also be specified.

Value

The value to search for

Return Value

Found position

・If the value is not found, -1 is returned.

Example

DIM A[]=[1,2,3,4,5]
?FIND(A,3)
2. Search an array for a specified value and return the found position

FIND Array,Value OUT Index1[,Index2...]

Arguments

Array

Target array to search

・Multi-dimensional arrays can also be specified.

Value

The value to search for

Return Value

The index of the found position

・The number of returned values must be the same as the number of dimensions of the searched target array.
・If no value is found, -1 is returned for all return values.

Example

DIM A$[3,3]=["1","2","3","4","5","6","7","8","9"]
FIND A$, "4" OUT Y,X
?A$[Y,X]
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
|