[↑]
SmileBASIC4 Replica Reference
LOADV
1. Read File Contents and Return as String or Array

LOADV("FileType:FileName")

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

DAT, TXT, GRP can be specified

・Cannot be omitted.

FileName

File name to read

Return Value

Contents of the read file

・If DAT and GRP are specified, it returns an array containing the data in the DAT and GRP files.
・If reading DAT and GRP files fails, it returns a 1D Int solution with 0 number of elements.
・When TXT is specified, it returns the string of the TXT file contents.
・If reading the TXT file fails, it returns an empty string.

Example

TX$=LOADV("TXT:MEMOFILE")
DT=LOADV("DAT:DATAFILE")
2. Read the Contents of a File into an Array

LOADV "FileType:FileName",Array

・The execution result can be obtained with the RESULT function.
・The value of RESULT is 1 for success, 0 for failure, and -1 for cancellation.

Arguments

FileType

DAT, GRP can be specified

・Cannot be omitted.

FileName

File name to read

Array

Array variable that stores the read data

・The dimension of the array data stored in the file to be read must match the dimension of the target array.
・When specifying a string array, the data in the file must also be saved from the string array.
・The number of array elements is automatically expanded according to the information in the file.

Example

DIM MARRAY[]
LOADV "DAT:MDATA",MARRAY
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
|