OpenAsText

Opens a file for reading as a text file.

Syntax

<HFMwFileReader>.OpenAsText bstrFileName

Argument

Description

bstrFileName

The name and path of the file to open.

Input argument. String subtype.

Example

The following function opens the specified file as a text file, then loops through it using ReadLine and IsEOF. When the end of the file is reached, Close is called.

Function loopThruTextFile(sFile)
Dim sTxt
Set cFileReader = Server.CreateObject("Hyperion.HFMwFileReader")
cFileReader.OpenAsText sFile
Do Until cFileReader.IsEOF() = TRUE
  sTxt = cFileReader.ReadLine()
  ' ... insert code to execute for each text line
Loop
cFileReader.Close
End Function