1

I have a simple file like:

124
123
122
121
120

I try to read it in softimage using jscript.

I have this:

var ForReading = 1;
var fso = new ActiveXObject("Scripting.FileSystemObject");
var fileObj = fso.GetFile("F:\\temp\\csv_reader_01.txt");
var ts = fileObj.OpenAsTextStream(ForReading, 0 );

while(!ts.AtEndOfSream) {
    var textLine = ts.ReadLine();
    LogMessage(textLine);
}
ts.Close();


LogMessage("done");

With the following output:

// INFO : 124
// INFO : 123
// INFO : 122
// INFO : 121
// INFO : 120
// ERROR : Input past end of file - [line 29]

It goes wrong at this line:

var textLine = ts.ReadLine();

How can this be solved, i would excpect the ! AtEndOfSream to do this.

clankill3r
  • 9,146
  • 20
  • 70
  • 126

1 Answers1

2

Is ts.AtEndOfSream a typo? It should be ts.AtEndOfStream (notice the missing 't' in 'Stream').

Cheran Shunmugavel
  • 8,319
  • 1
  • 33
  • 40