.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
DescriptionFunction EOF returns TRUE if the file pointer of an open text file has reached the end of the file (EOF marker). Function EOF is used with Procedures Read and ReadLn to ensure proper file reading and closure. Parameter fileName specifies a text file which is open for reading or writing.
If the filename includes a fully qualified path, the path has to use the appropriate notation for the local operating system:
If the filename includes a path relative to the location of the VectorWorks executable, the subfolder delimiters have to be backslashes:
If the filename does not include a path, the file is assumed to exist in the same folder as the VectorWorks executable.
fileName :STRING) : BOOLEAN;
def vs.EOF(fileName): return BOOLEAN
fileName STRING Name of file.
BEGIN Open('MyData'); WHILE NOT EOF('MyData') DO ReadLn(a,b,c,d); Close('MyData'); END;
def Example(): vs.Open('D:\test.txt') while not vs.EOF('D:\test.txt'): a,b,c,d = vs.ReadLn() vs.Close('D:\test.txt') vs.Message(a) Example()