FileTools[Text] - Maple Programming Help

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

FileTools[Text]

 CountIntegers
 count the number of integers from current file position to the end of the file

 Calling Sequence CountIntegers(file)

Parameters

 file - file descriptor or filename

Description

 • The CountIntegers(file) command counts the number of integers from the current position in file to the end of file.
 • The CountIntegers function returns the number of times ReadNextInteger can be called before the end of the file is reached.
 • An error is raised if file is not a valid descriptor or if it is the name of a file that does not exist.

Examples

 > ${{\mathrm{FileTools}}_{\mathrm{Text}}}_{\mathrm{WriteString}}\left("foo","1 2 3 abcd 1234 ege 4 5"\right)$
 ${24}$ (1)
 > ${{\mathrm{FileTools}}_{\mathrm{Text}}}_{\mathrm{Close}}\left("foo"\right):$
 > ${{\mathrm{FileTools}}_{\mathrm{Text}}}_{\mathrm{CountIntegers}}\left("foo"\right)$
 ${6}$ (2)
 > ${\mathrm{FileTools}}_{\mathrm{Remove}}\left("foo"\right):$