FileTools[Text] - Maple Help

Online Help

All Products    Maple    MapleSim


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

FileTools[Text]

  

ReadCharacter

  

read a single character from a file

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ReadCharacter(file)

Parameters

file

-

file descriptor or filename

Description

• 

The ReadCharacter(file) command reads a single character from file.  The character is returned as a string of length 1.

• 

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 does not exists.

• 

If the end of the file has been reached, ReadCharacter returns NULL.

Examples

FileTools[Text][WriteString]file,123

3

(1)

FileTools[Text][Close]file:

FileTools[Text][ReadCharacter]file

1

(2)

FileTools[Text][ReadCharacter]file

2

(3)

FileTools[Text][ReadCharacter]file

3

(4)

FileTools[Text][ReadCharacter]file

See Also

file

FileTools[AtEndOfFile]

FileTools[Text]

FileTools[Text][Close]

FileTools[Text][Open]

FileTools[Text][ReadString]

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