Open main menu

UESPWiki β

Morrowind Mod:XFileReadText

< Mod / Morrowind: Morrowind Mod: MWSE

A function added by MWSE.

xFileReadText reads a text string from the file at the current reading position. The current position is then advanced. The pattern string is then used to extract data from the string just read; the first return value indicates how much of the pattern is matched. The values matched by the pattern are also returned. The patterns and return values are the same as for the xStringParse function with one addition: placing a singleĀ % sign at the end of the pattern will cause the read routine to stop when it gets to the end of a line (CR/LF) allowing you to use this to read a normal text file instead of a binary file. Without the trailingĀ % sign on the pattern this will read up to the first NULL character or to the end of the file if it doesn't find a NULL character.

SyntaxEdit

matches (long), ...: xFileReadText filename (string), pattern (string)

ExampleEdit

See AlsoEdit