L3DT users' wiki
Large 3D terrain generator

fclose

Description

Close a file handle.

Function prototype

bool fclose <voidptr:hFile>

Arguments

Name Type Comment
hFile voidptr A handle to a file that was previously opened by fopen or fopen_s.

Return value

False if:

  • The file handle is invalid, or;
  • The file handle cannot be closed.

True otherwise.

Example

voidptr fp // create a file handle
set fp <zs:fopen "C:\\test.txt" "w"> // open the file, and assign the value to 'fp'
assert fp "Cannot open file!" // exit if file can't be opened

string s
set string "Hello!"
fwrite fp s // write text to file

fclose fp // close file

Comments

None.

See also

 
plugins/general/zeoscript/reference/functions/fclose.txt · Last modified: 2017/08/31 04:25 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki