| Command group | Flag affected | Reversible | Execute on client | Platform(s) |
| External commands | YES | NO | NO | Windows,Linux |
Note: The flag is set according to whether Omnis was able to make a call to this external command.
This command closes a file previously opened by the Open file command. You specify the file reference number returned by Open file in refnum. You should call Close file for each files you open with Open file, when you have finished using the file.
It returns an error code (See Error Codes), or zero if no error occurs.
# read a text file then close it
CalculatelPathnameascon(sys(115),'html',sys(9),'serverusagetask.htm')
Open file(lPathname,lRefNum)ReturnslErrCode## opens the file
Read file as character(lRefNum,lFile)ReturnslErrCode## reads the file contents into lFileClose file(lRefNum)ReturnslErrCode## now close the file