FILEOPEN
Syntax
FUNCTION FILEOPEN( *"filenameString",
param *
)
Description
FILEOPEN is built into version
8.30 and later.
The filename is a string. File names are limited of up to 8 characters period followed by up to 3 characters. Spaces are NOT allowed in filenames
param is a single character "r" for read, "w" for write, and "a" for append, single characters are treated like the integer value of the ASCII character. "w" will overwrite an existing file.
The function returns 1 for a successful open.
In this version ONLY ONE file can be open at a time.\
Error codes:
-1 FR_NOT_READY
-2 FR_NO_FILE
-3 FR_NO_PATH
-4 FR_INVALID_NAME
-6 FR_DENIED
-7 FR_EXIST
-8 FR_RW_ERROR
-11 FR_NO_FILESYSTEM
-12 FR_INVALID_OBJECT
We support the FAT16 file system which limits you to 4GB SDcards or partioned cards that are larger. If you are an OEM interested in FAT32 support, contact us about updating that firmware.\
Example
\
i = fileopen("logfile.txt",
"w")
if i <> 1
then
printf("OPEN FAILED %d, TRY AGAIN",
i)
i = fileopen("logfile.txt",
"w")
' try again
endif
\
Differences from other BASICs
\
- no equivalent Visual BASIC
- no equivalent in PBASIC
See also
\