VS:EOF

From Vectorworks Developer
Revision as of 14:29, 12 August 2013 by Root (talk | contribs) (1 revision)
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Function 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:

<dir>Macintosh HD:Applications:VectorWorks:Plug-Ins:Data:Notes.txt</dir> <dir>C:Program FilesVectorWorksPlug-InsDataNotes.txt</dir> If the filename includes a path relative to the location of the VectorWorks executable, the subfolder delimiters have to be backslashes:

<dir>Plug-InsDataNotes.txt</dir> If the filename does not include a path, the file is assumed to exist in the same folder as the VectorWorks executable.

FUNCTION EOF(
fileName :STRING) : BOOLEAN;
def vs.EOF(fileName):
    return BOOLEAN

Parameters

fileName STRING Name of file.

Example

VectorScript

BEGIN
Open('MyData');
WHILE NOT EOF('MyData') DO
ReadLn(a,b,c,d);
Close('MyData');
END;

Python

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()

Version

Availability: from All Versions