FileTools[Text] - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : File Manipulation : FileTools : FileTools/Text/ReadLine

FileTools[Text]

  

ReadLine

  

read a line from a file

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ReadLine(file)

Parameters

file

-

file descriptor or filename

Description

• 

The ReadLine(file) command reads a string containing all the characters from the current file position to the first newline character or the end of file.  The characters are returned as a string.

• 

If the current file position is the end of the file, a call to ReadLine returns NULL, but ReadLine does not automatically close file. This behavior is different from readline.

Examples

FileTools[Text][WriteLine]testfile,This is a test

15

(1)

FileTools[Text][WriteLine]testfile,This is also a test

20

(2)

FileTools[Text][Close]testfile

FileTools[Text][ReadLine]testfile

This is a test

(3)

FileTools[Text][ReadLine]testfile

This is also a test

(4)

FileTools[Text][ReadLine]testfile

FileTools[Remove]testfile

See Also

file

FileTools[Remove]

FileTools[Text]

FileTools[Text][Close]

FileTools[Text][Open]

FileTools[Text][WriteLine]

FileTools[Text][WriteString]

IO_errors

readline

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam