Edit

File_ReadLine (filehandle)

Result Type:  string

Definition:  Reads and returns a string containing one line of the file from the current mark up to the next \n, \r or \r\n. The string contains the line ending character, but if the line ending is \r\n the trailing \n is excluded and you will only get the \r.

At the end of the file, the return value will be an empty string (an empty line in the file would return with the newline)

Example: 

let fd = File_Open("a file in the MoneyWorks Automation dir.txt")
if fd <> NULL
    while true
        let line = File_ReadLine(fd)
        if line == ""
            break
        endif
        syslog(line)
    endwhile
    File_Close(fd)
endif

Limits:  Maximum line length is 4K. If you need to read lines of arbitrary length, use File_Read.

Availability:  available within MWScript handlers.

See Also:

AddSafePath: UI to add a safe path to the preferences

CreateFolder: Create a new folder

File_Close: File functions for creating/reading/writing text files

File_GetLength: File length in bytes

File_GetMark: Get current read/write position

File_Move: Rename/move a file

File_Open: Open a file

File_Path: Get the full path of an open file

File_Read: Read text from current position

File_SetMark: Set Current read/write position

File_Write: Write text at current position

WriteToTempFile: Create a temp file containing the string