[↑]
SmileBASIC4 Replica Reference
FILES
1. Display a List of Files on the Console

FILES ["FileType:"]
FILES "[FileType:] ProjectName"

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

Arguments

FileType

Specify when you want to display a specific file type.

・If not specified, all files will be displayed.

ProjectName

The name of the project for which you want to get a list

・If not specified, a list of files in the current project will be displayed.

Example

FILES
FILES "TXT:PROJECT" 
2. Display a List of Projects on the Console

FILES "//"

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

Argument

"//"

If "//" is specified, the project list is displayed.

Example

FILES "//" 
3. Create an Array Containing a List of Files and Projects

FILES(["FileType:"])
FILES("[FileType:] ProjectName")

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

Arguments

FileType

Specify when you want to get a specific file type

・If not specified, all files are acquired.

ProjectName

The name of the project for which you want to get a list

・If not specified, get a list of files in the current project.

Return Value

A string array containing a list of files

Example

NAMETBL$ = FILES()
FOR I=0 TO LAST(NAMETBL$)
 ?NAMETBL$[I]
NEXT
4. Create an Array Containing a List of Projects

FILES("//")

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

Argument

"//"

If "//" is specified, the project list is acquired.

Return Value

A string array containing a list of projects

Example

NAMETBL$ = FILES("//")
FOR I=0 TO LAST(NAMETBL$)
 ?NAMETBL$[I]
NEXT
5. Get a List of Files in Array

FILES ["FileType:",]StringArray
FILES "[FileType:]ProjectName,StringArray

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

Arguments

FileType

Specify when you want to get a specific file type

ProjectName

The name of the project for which you want to get a list.

・If not specified, get a list of files in the current project.

StringArray

・A string array that stores the file names in the file list.
・In the case of a one-dimensional array, it is automatically expanded according to the number of acquired files.

Example

DIM NAMETBL$[]
FILES NAMETBL$
FOR I=0 TO LAST(NAMETBL$)
 ?NAMETBL$[I]
NEXT
6. Get a List of Projects in Array

FILES "//",StringArray

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

Arguments

"//"

If "//" is specified, the project list is acquired.

StringArray

・A string array that stores the project names in the project list.
・In the case of a one-dimensional array, it is automatically expanded according to the number of acquired files.

Example

DIM NAMETBL$[]
FILES "//", NAMETBL$
FOR I=0 TO LAST(NAMETBL$)
 ?NAMETBL$[I]
NEXT
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
|