|
AppendString
int AppendString(string
filename, string data)
Return
Value
Returns OK if the string has been
successfully written. Otherwise, returns FAIL.
Parameters
filename
–the name of the
file to write to.
data
–the
string to be written.
Remarks
Appends ASCII
text from data to the end of file file indicated by
filename. The function does not close file. Use CloseFile function to close the file. Note that
this function does not create the folder specified in the
filename. If a folder does not exist the function
will fail. Use CreateDir function to create a
folder.
Package
Plug in module:
nd_fileplg.npl
Example
The following
example demonstrates the use of AppendString.
# Example for AppendString
AppendString("C:\txt.txt","string
1")
AppendString("C:\txt.txt","string
2")
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
|