|
CloseFile
int
CloseFile (string
filename)
Return
Value
Returns
OK if success. Otherwise returns FAIL.
Parameters
filename
–the name of the
file to close.
Remarks
Call this
function to close the file indicated by filename.
Package
Plug in module:
nd_fileplg.npl
Example
The following
example demonstrates the use of CloseFile.
# Example for CloseFile
WriteString("C:\txt.txt","string
1")
WriteString("C:\txt.txt","string
2")
WriteString("C:\txt.txt","string
3")
WriteString("C:\txt.txt","string
4")
WriteString("C:\txt.txt","string
5")
CloseFile("C:\txt.txt")
#read test
while
!EOF("C:\txt.txt")
Println("String
is:",
ReadString("C:\txt.txt"))
endwhile
CloseFile("C:\txt.txt")
#remove file
RemoveFile("C:\txt.txt")
Output of the example
script:
String
is: string 1
String
is: string 2
String
is: string 3
String
is: string 4
String
is: string 5
|