CountFloats - Maple Help

FileTools[Text]

 CountFloats
 count the number of floating-point numbers from current file position to the end of the file

 Calling Sequence CountFloats(file)

Parameters

 file - file descriptor or filename

Description

 • The CountFloats(file) command counts the number of floating-point numbers from the current position in file to the end of file.
 • The CountFloats function returns the number of times ReadNextFloat 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}\left[\mathrm{Text}\right]\left[\mathrm{WriteString}\right]\left("foo","1\n2\n3\nabcd 1234 ege\n\n4\n5"\right)$
 ${24}$ (1)
 > $\mathrm{FileTools}\left[\mathrm{Text}\right]\left[\mathrm{Close}\right]\left("foo"\right):$
 > $\mathrm{FileTools}\left[\mathrm{Text}\right]\left[\mathrm{CountFloats}\right]\left("foo"\right)$
 ${6}$ (2)
 > $\mathrm{FileTools}\left[\mathrm{Remove}\right]\left("foo"\right):$