JavaScript Tutorial/MS JScript/TextStream

Материал из Web эксперт
Перейти к: навигация, поиск

TextStream

The TextStream object is created by calling the CreateTextFile() method of the FileSystemObject object.

Methods and Properties of the TextStream Object

Method/Property Description Close() Closes the file Read() Reads in a specified number of characters ReadAll() Reads the entire file ReadLine() Reads a line of the file up to the newline character Skip() Skips the specified number of characters SkipLine() Skips the next line when reading the file Write() Writes a string to the file WriteBlankLines() Writes the specified number of blank lines to the file WriteLine() Writes a string followed by a newline character to the file AtEndOfLine Returns true if the pointer is immediately before the end-of-line marker AtEndOfStream Returns true if the pointer is at the end of the file Column Returns the column number of the current pointer position Line Returns the line number of the current pointer position



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.AtEndOfLine

The AtEndOfLine property returns true when the end of a line in a text line is found.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.AtEndOfStream

The AtEndOfStream property returns true when the end of a line in a text file is found.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.Close()

The Close() method closes the previously opened file.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.Column

The Column property returns the column number of the current pointer position.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.Line

The Line property returns the line number of the current pointer position.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.Read()

Syntax



   <source lang="javascript">

textstream.Read(num)</source>


TextStream.ReadAll()

The ReadAll() method reads the entire text file.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.ReadLine()

The ReadLine() method reads a line from a text file up to a newline character.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.Skip()

Syntax



   <source lang="javascript">

textstream.Skip(num)</source>


TextStream.SkipLine()

The SkipLine() skips the next line.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>


TextStream.Write()

Syntax



   <source lang="javascript">

textstream.Write(string)</source>


TextStream.WriteBlankLines()

Syntax



   <source lang="javascript">

textstream.WriteBlankLines(num)</source>


TextStream.WriteLine()

The WriteLine() method writes a string followed by a newline to the text file.



   <source lang="javascript">

<html>

   <script language="JScript">
   
   </script>

</html></source>