FILEOPEN

 
Syntax


FUNCTION FILEOPEN(  "filenameString", "param"  )

Description


FILEOPEN is built into version 8.30 and later.

The filename is a string.  param is a single character "r" for read, "w" for write, and "a" for append.

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

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

See also