FileTools[Text] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

FileTools[Text]

  

ReadString

  

read a string from a file

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ReadString(file)

Parameters

file

-

file descriptor or filename

Description

• 

The ReadString(file) command reads a whitespace delimited string from file.

• 

If file is the name of a file that has not been opened, Maple attempts to open the file before reading the character.

• 

An error is raised if file is not a valid descriptor or if it is the name of a file that cannot be opened.

• 

If the end of the file has been reached, ReadString returns NULL. To determine if the end of file has been reached, use AtEndOfFile.

Examples

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

15

(1)

FileTools[Text][Close]testfile:

FileTools[Text][ReadString]testfile

This

(2)

FileTools[Text][ReadString]testfile

is

(3)

FileTools[Text][ReadString]testfile

a

(4)

FileTools[Text][ReadString]testfile

test

(5)

FileTools[Text][ReadString]testfile

See Also

file

FileTools[AtEndOfFile]

FileTools[Text]

FileTools[Text][Close]

FileTools[Text][Open]

FileTools[Text][ReadCharacter]

FileTools[Text][WriteCharacter]

FileTools[Text][WriteString]

IO_errors

 


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