ReadTextFile

Prev Next Home Home Table Of Contents Index

ReadTextFile (FileName,Array)

This command reads a text file into a string array. It also sets the variable LongestLine to the length of the longest line in the file.


Example:
Var Docs

ReadTextFile('MARXMENU.DOC',Docs) ;After the read, Docs[1] becomes the first line of the file. ;Docs[NumberOfElements(Docs)] becomes the last line. Loop Docs ; Convert each line to its uppercase equivalent LoopVal = UpperCase LoopVal EndLoop ;Save the newly formatted array WriteTextFile ('NEWMM.DOC',Docs)

Do not use FileOpen with ReadTextFile.

The power of the ReadTextFile and WriteTextFile have expanded. You can now load and save arrays of any variable types, multidimensional arrays, and mixed array types. This includes strings, numbers, and booleans. File variables are also stored. When a file variable is stored and reloaded the FileAssign command is not necessary.

See Also: LongestLine TextWrapPoint

Category: File Array LongName

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home