The %close() function closes the UNIX file specified by file.descriptor returned by a previous call to %open(), %creat(), %dup(), %socket(), or %accept().
All host OS files opened from a FlashBASIC program are closed automatically at main program termination. However, it is a safe practice to close files explicitly.
var = %close(file.descriptor)
if %close(fd) then crt ’Cannot close file’ stop end
Note the use of the implicit (void) casting by not including the statement as part of an assignment. The return code of the close is thrown away.