Sideway
output.to from Sideway
Draft for Information Only

Content

TextStream Object
TextStream.AtEndOfLine
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:
TextStream.AtEndOfStream
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:
TextStream.Column
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:
TextStream.Line
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:

TextStream Object

One key function of FileSystemObject Component is the manipulation of text file of the file system. TextStream Object facilitates sequential access to text file.

TextStream.AtEndOfLine

TextStream.AtEndOfLine property is a read only property to check whether the file pointer is positioned immediately before the end-of-line marker in the specified TextStream object instance or not.

Syntax:

TextStreamName.AtEndOfLine

 Or in VBScript. Imply

 textatlineendflag =TextStreamName.AtEndOfLine

 Or in JScript. Imply

 textatlineendflag =TextStreamName.AtEndOfLine

Parameters:

textatlineendflag

The parameter "textatlineendflag" is the name assigned to the boolean value returned by the AtEndOfLine property referred to the specified TextStreamName object.

TextStreamName

The parameter "TextStreamName" is used to specify the name of the instance of the TextStream Object related to.

Returns:

Boolean value

The return value of the AtEndOfLine property is true if the file pointer is positioned immediately before the end-of-line marker in the TextStream file. The return value of the AtEndOfLine property is false if the file pointer is not positioned immediately before the end-of-line marker in the TextStream file.

Remarks:

TextStreamName refers to a TextStream Object.

Before using the AtEndOfLine property of a TextStream Object, the specified TextStream Object must be created using the CreateTextFile method or OpenTextFile method of a FileSystemObject object or the OpenAsTextStream method of a File object.

The AtEndOfLine property applies to TextStream files opened for reading only, an error occurs if the TextStream file is not opend for reading.

Examples:

  • Example of using the AtEndOfLine property to check whether the TextStream object is positioned at the end of line in the text stream of the text file or not.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, textobjectname, textatlineendflag
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set textobjectname = fso.OpenTextFile("d:\temp1\test.txt")
    Response.Write textobjectname.Read(6) & "<br />"
    textatlineendflag = textobjectname.AtEndOfLine
    Response.Write textatlineendflag & "<br />"
    Response.Write textobjectname.Readline() & "<br /> "
    Response.Write textobjectname.AtEndOfLine & "<br />"
    Response.Write textobjectname.Read(2) & "<br />"
    Response.Write textobjectname.AtEndOfLine & "<br />"
    textobjectname.Close
    </script>

    HTML web page ouput:

    line 1
    True

    False
    li
    False

  • Example of using the AtEndOfLine property to check whether the TextStream object is positioned at the end of line in the text stream of the text file or not.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, textobjectname, textatlineendflag;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    textobjectname = fso.OpenTextFile("d:\\temp1\\test.txt")
    Response.Write (textobjectname.Read(6) + "<br />");
    textatlineendflag = textobjectname.AtEndOfLine
    Response.Write (textatlineendflag + "<br />");
    Response.Write (textobjectname.Readline() + "<br /> ");
    Response.Write (textobjectname.AtEndOfLine + "<br />");
    Response.Write (textobjectname.Read(2) + "<br />");
    Response.Write (textobjectname.AtEndOfLine + "<br />" );
    textobjectname.Close();;
    </script>

    HTML web page ouput:

    line 1
    True

    False
    li
    False

TextStream.AtEndOfStream

TextStream.AtEndOfStream property is a read only property to check whether the file pointer is positioned at the end of the text stream in the specified TextStream object instance or not.

Syntax:

TextStreamName.AtEndOfStream

 Or in VBScript. Imply

 textatstreamendflag =TextStreamName.AtEndOfStream

 Or in JScript. Imply

 textatstreamendflag =TextStreamName.AtEndOfStream

Parameters:

textatstreamendflag

The parameter "textatstreamendflag" is the name assigned to the boolean value returned by the AtEndOfStream property referred to the specified TextStreamName object.

TextStreamName

The parameter "TextStreamName" is used to specify the name of the instance of the TextStream Object related to.

Returns:

Boolean value

The return value of the AtEndOfStream property is true if the file pointer is positioned immediately at the end of the text stream in the TextStream file. The return value of the AtEndOfStream property is false if the file pointer is not positioned immediately before the end of the text stream in the TextStream file.

Remarks:

TextStreamName refers to a TextStream Object.

Before using the AtEndOfStream property of a TextStream Object, the specified TextStream Object must be created using the CreateTextFile method or OpenTextFile method of a FileSystemObject object or the OpenAsTextStream method of a File object.

The AtEndOfStream property applies to TextStream files opened for reading only, an error occurs if the TextStream file is not opend for reading.

Examples:

  • Example of using the AtEndOfStream property to check whether the TextStream object is positioned at the end of the text stream of the text file or not.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, textobjectname, textatstreamendflag
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set textobjectname = fso.OpenTextFile("d:\temp1\test.txt")
    Response.Write textobjectname.Readline() & "<br /> "
    textatstreamendflag = textobjectname.AtEndOfStream
    Response.Write textatstreamendflag & "<br />"
    Response.Write textobjectname.ReadAll() & "<br />"
    Response.Write textobjectname.AtEndOfStream & "<br />"
    textobjectname.Close
    </script>

    HTML web page ouput:

    line 1
    False
    line 2
    True

  • Example of using the AtEndOfStream property to check whether the TextStream object is positioned  at the end of the text stream of the text file or not.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, textobjectname, textatstreamendflag;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    textobjectname = fso.OpenTextFile("d:\\temp1\\test.txt");
    Response.Write (textobjectname.Readline() + "<br /> ");
    textatstreamendflag = textobjectname.AtEndOfStream;
    Response.Write (textatstreamendflag + "<br />");
    Response.Write (textobjectname.ReadAll() + "<br />");
    Response.Write (textobjectname.AtEndOfStream + "<br />" );;
    textobjectname.Close();
    </script>

    HTML web page ouput:

    line 1
    false
    line 2
    true

TextStream.Column

TextStream.Column property is a read only property to get the column number of the current file pointer position in a line of the text stream of the specified file object instance.

Syntax:

TextStreamName.Column

 Or in VBScript. Imply

 textcolumn =TextStreamName.Column

 Or in JScript. Imply

 textcolumn =TextStreamName.Column

Parameters:

 textcolumn

The parameter "textcolumn" is the name assigned to the value returned by the Column property referred to the specified TextStreamName object.

TextStreamName

The parameter "TextStreamName" is used to specify the name of the instance of the TextStream Object related to.

Returns:

numerical value

The return value of the Column property is the number of the vertical position of the file pointer in a text line of the text stream file.

Remarks:

TextStreamName refers to a TextStream Object.

Before using the Column property of a TextStream Object, the specified TextStream Object must be created using the CreateTextFile method or OpenTextFile method of a FileSystemObject object or the OpenAsTextStream method of a File object.

The Column property returns 1, after a newline character has been written, but before any other character is written.

Examples:

  • Example of using the Column property to get the vertical position of the file pointer in a text line of the text stream  file.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, textobjectname, textcolumn
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set textobjectname = fso.OpenTextFile("d:\temp1\test.txt")
    Response.Write textobjectname.Read(6) & "<br />"
    textcolumn = textobjectname.Column
    Response.Write textcolumn & "<br />"
    Response.Write textobjectname.Readline() & "<br />"
    Response.Write textobjectname.Column & "<br />"
    Response.Write textobjectname.ReadAll() & "<br />"
    Response.Write textobjectname.Column & "<br />"
    textobjectname.Close
    </script>

    HTML web page ouput:

    line 1
    7

    1
    line 2
    1

  • Example of using the Column property to get the vertical position of the file pointer in a text line of the text stream  file.

    ASP JScript command:

    <script runat="server" language="JScript">
    Response.Write("a<br><br>");
    var fso, textobjectname, textcolumn;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    textobjectname = fso.OpenTextFile("d:\\temp1\\test.txt");
    Response.Write (textobjectname.Read(6) + "<br />");
    textcolumn = textobjectname.Column;
    Response.Write(textcolumn + "<br />");
    Response.Write(textobjectname.Readline() + "<br /> ");
    Response.Write(textobjectname.Column + "<br />");
    Response.Write(textobjectname.ReadAll() + "<br />");
    Response.Write(textobjectname.Column + "<br />");
    textobjectname.Close();
    </script>

    HTML web page ouput:

    line 1
    7

    1
    line 2
    1

TextStream.Line

TextStream.Line property is a read only property to get the line number of the current file pointer position in the text stream of the specified file object instance.

Syntax:

TextStreamName.Line

 Or in VBScript. Imply

 textrow =TextStreamName.Line

 Or in JScript. Imply

 textrow =TextStreamName.Line

Parameters:

 textrow

The parameter "textrow" is the name assigned to the value returned by the Line property referred to the specified TextStreamName object.

TextStreamName

The parameter "TextStreamName" is used to specify the name of the instance of the TextStream Object related to.

Returns:

numerical value

The return value of the Line property is the number of the horizontal position of the file pointer of the corresponding text line in the text stream file.

Remarks:

TextStreamName refers to a TextStream Object.

Before using the Line property of a TextStream Object, the specified TextStream Object must be created using the CreateTextFile method or OpenTextFile method of a FileSystemObject object or the OpenAsTextStream method of a File object.

The Line property returns 1, after a file is initally opened and before any other character is read.

Examples:

  • Example of using the Line property to get the line number of the file pointer in a text line of the text stream file.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, textobjectname, textrow
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set textobjectname = fso.OpenTextFile("d:\temp1\test.txt")
    Response.Write textobjectname.Read(6) & "<br />"
    textrow= textobjectname.Line
    Response.Write textrow & "<br />"
    Response.Write textobjectname.Readline() & "<br />"
    Response.Write textobjectname.Line & "<br />"
    Response.Write textobjectname.ReadAll() & "<br />"
    Response.Write textobjectname.Line & "<br />"
    textobjectname.Close
    </script>

    HTML web page ouput:

    line 1
    1

    2
    line 2
    3

  • Example of using the Line property to get the line number of the file pointer in a text line of the text stream file.

    ASP JScript command:

    <script runat="server" language="JScript">
    Response.Write("a<br><br>");
    var fso, textobjectname, textrow;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    textobjectname = fso.OpenTextFile("d:\\temp1\\test.txt");
    Response.Write (textobjectname.Read(6) + "<br />");
    textrow = textobjectname.Line;
    Response.Write(textrow + "<br />");
    Response.Write(textobjectname.Readline() + "<br /> ");
    Response.Write(textobjectname.Line + "<br />");
    Response.Write(textobjectname.ReadAll() + "<br />");
    Response.Write(textobjectname.Line + "<br />");
    textobjectname.Close();
    </script>

    HTML web page ouput:

    line 1
    1

    2
    line 2
    3


©sideway

ID: 130300033 Last Updated: 3/27/2013 Revision: 0 Ref:

close

References

  1. Active Server Pages,  , http://msdn.microsoft.com/en-us/library/aa286483.aspx
  2. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929%28v=vs.90%29.aspx
  3. ASP Best Practices,  , http://technet.microsoft.com/en-us/library/cc939157.aspx
  4. ASP Built-in Objects,  , http://msdn.microsoft.com/en-us/library/ie/ms524716(v=vs.90).aspx
  5. Response Object,  , http://msdn.microsoft.com/en-us/library/ms525405(v=vs.90).aspx
  6. Request Object,  , http://msdn.microsoft.com/en-us/library/ms524948(v=vs.90).aspx
  7. Server Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525541(v=vs.90).aspx
  8. Application Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525360(v=vs.90).aspx
  9. Session Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms524319(8v=vs.90).aspx
  10. ASPError Object,  , http://msdn.microsoft.com/en-us/library/ms524942(v=vs.90).aspx
  11. ObjectContext Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525667(v=vs.90).aspx
  12. Debugging Global.asa Files,  , http://msdn.microsoft.com/en-us/library/aa291249(v=vs.71).aspx
  13. How to: Debug Global.asa files,  , http://msdn.microsoft.com/en-us/library/ms241868(v=vs.80).aspx
  14. Calling COM Components from ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524620(v=VS.90).aspx
  15. IIS ASP Scripting Reference,  , http://msdn.microsoft.com/en-us/library/ms524664(v=vs.90).aspx
  16. ASP Keywords,  , http://msdn.microsoft.com/en-us/library/ms524672(v=vs.90).aspx
  17. Creating Simple ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524741(v=vs.90).aspx
  18. Including Files in ASP Applications,  , http://msdn.microsoft.com/en-us/library/ms524876(v=vs.90).aspx
  19. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929(v=vs.90).aspx
  20. FileSystemObject Object,  , http://msdn.microsoft.com/en-us/library/z9ty6h50(v=vs.84).aspx
  21. http://msdn.microsoft.com/en-us/library/windows/desktop/ms675944(v=vs.85).aspx,  , ADO Object Model
  22. ADO Fundamentals,  , http://msdn.microsoft.com/en-us/library/windows/desktop/ms680928(v=vs.85).aspx
close

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019