
5.5.1.3. OpenFile Function
OpenFile Function
Opens text file using the specified mode, returns file ID.
Syntax
double OpenFile(string filePath, string mode)
Parameters
Parameter Type Description
filePath string Full path of the file.
mode string File open mode. Can be either "r", "rt" (read), "w" or
"wt" (write).
Returns
Returns file ID.
Comments
None
Usage
NexScript
% open a file in read mode
file = OpenFile("C:\parameters.txt", "r")
% read all the lines in the file and print them
if file > 0
line = " " % make line a string variable
while ReadLine(file, line) > 0
Trace(line)
end
CloseFile(file)
end
See Also
Introduction to NexScript Programming
NexScript Function Categories
Page 143
Comentarios a estos manuales