|
SeekToBegin
int SeekToBegin(string
filename)
Return
Value
Returns the new byte
offset from the beginning of the file if operation successful.
Otherwise, the return value is FAIL.
Parameters
filename
– the name of
the file.
Remarks
Call SeekToBegin function to reposition the pointer to the
beginning of the file. No data is actually read during the
seek.
Package
Plug in module:
nd_fileplg.npl
Example
The following
example demonstrates the use of SeekToBegin.
# Example for SeekToBegin
string sData
string sFileName = "C:\test.txt"
for(int
i=0; i<5; i++)
sData
= "String_" + ToString(i)
WriteString(sFileName, sData)
endfor
SeekToBegin(sFileName)
while(!EOF(sFileName))
Println(ReadString(sFileName))
endwhile
CloseFile(sFileName)
Output of the example
script:
String_0
String_1
String_2
String_3
String_4
|