|
ReadString
string
ReadString(string
filename)
Return
Value
Returns string containing text
data.
Parameters
filename
–the name of the
file to read from.
Remarks
Reads single
line from the ASCII file. The function will open file if it is
closed. The file pointer will be moved to the next line. If the
function fails the return value is empty string.
Package
Plug in module:
nd_fileplg.npl
Example
The following
example demonstrates the use of ReadString.
# Example for ReadString
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
|