basic.%close C Function/BASIC Program

basic.%close

Command basic.%close C Function/BASIC Program
Applicable release versions: AP/Unix
Category BASIC Program (486)
Description closes the Unix file specified by "file.descriptor" returned by a previous call to %open(), %creat(), %dup(), %socket() or %accept().

All Unix files opened from a FlashBASIC or Pick/BASIC program are closed automatically at main program termination. It is a safe practice, though, to close files explicitly.
Syntax variable=%close(file.descriptor)
Options
Example
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.
Purpose
Related basic.%creat
basic.%dup
basic.cfunc
basic.cfunction
basic.%ttyname
basic.%unlink
basic.%open
basic.%socket
basic.%accept
basic.%connect
basic.%fsize
basic.%listen