Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=130300033

AtEndOfLine / AtEndOfStream / Column / LineASP Server Component, TextStream Object

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

Link:http://output.to/sideway/default.asp?qno=130300034

Program ShortCut Quick Launch Toolbar on TaskBar

Quick Launch Shortcut ToolBar for Windows XP:

source:  http://windows.microsoft.com/en-us/windows-vista/add-or-remove-programs-on-the-quick-launch-toolbar  , http://support.microsoft.com/kb/171206 http://windows.microsoft.com/en-us/windows-xp/help/display-quick-launch-toolbar ,    last updated 3/28/2013 and others

The "Quick Launch" toolbar is a program starting toolbar with one click for Windows XP. The "Quick Launch" toolbar is located in the TaskBar on the DeskTop. Like the Start Menu, the Quick Launch toolbar is also actually a tailor arranged representation of a folder tree for individual user in the TaskBar.

   image

By default the Quick Launch toolbar is hidden. The Quick Launch toolbar can be activated by simply a right click the mouse while pointing at any clear space on the taskbar and then select Toolbars and check Quick Launch.

   image

The advantage of placing quick launch short cut in Quick Launch toolbar over placing program short cut on DeskTop is the always visible property of the Quick Launch toolbar by default when windows are opened on the DeskTop while icons on the desktop are usually covered by the opened windows.

Quick Launch ToolBar:

The position of Quick Launch in the ToolBar can be relocated by moving the mouse to the clear space near the double bar divider and then click and hold the left mouse button to activate the move cursor icon for moving the Quick Launch ToolBar inside the TaskBar. 

   image

The size of Quick Launch in the ToolBar can be resized by moving the mouse on double bar divider to activate the two sided arrow cursor icon for resizing and then click and hold the left mouse button to activate the two sided draging arrow cursor icon for draging the size of Quick Launch ToolBar inside the TaskBar. 

  image image

The icon size of Quick Launch in the ToolBar can be resized by moving the mouse to the clear space near the double bar divider, or after activated the move cursor icon or the two sided arrow cursor icon and then click the right mouse button to activate the context menu for clicking "view" to select either "large icons" or "small icons". 

   image image image image

A double chevron button on the Quick Launch indicates that more shortcut icons are available in the Quick Launch. The extra shortcut icons are available by right clicking on the double chevron button. 

   image

The shortcut icons of Quick Launch can also be movied in the TaskBar. The movement can be doned by moving the corresponding shortcut icon after right click and hold, to the needed position accordingly. The arrangement of shortcut icons in the Quick Launch toolbar can be tailored arranged for each individual user. The Quick Launch toolbar for each user can be considered as the representation of the Quick Launch folder of the corresponding user.

  image image

Quick Launch Folder:

The "Quick Launch" toolbar  in the TaskBar is only the representation of a folder tree of an indivdual user. There is a "default user" Quick Launch for all new users. The location of the "Quick Launch" folder is on "C:\Documents and Settings\Default User\Application Data\Microsoft\Internet Explorer\Quick Launch"

   image

The location of the "Quick Launch" folder for each individual user is also in the  "C:\Documents and Settings\" folder under the name of corresponding user folder. The "Quick Launch" folder of individual user can be opened by the command Run "%Appdata%\Microsoft\Internet Explorer\Quick Launch"

  image  image

Or, the "Quick Launch" folder of individual user can be opened by moving the mouse to the clear space or near the double bar divider and then click the right mouse button to activate the context menu for clicking "Open Folder".

   image

Since both folders, sub-folders and Quick Launch shortcuts can be saved in the Quick Launch folder, Quick Launch shortcut icons in the Quick Launch in the Quick Launch folder displayed on the Quick Launch Toolbar can be organized in a tree like structure. Therefore most commonly used Quick Launch shortcuts can be placed in the Quick Launch folder, and less comonly used Quick Launch shortcuts can be moved to the sub folders, or sub sub folders. In the folder explorer, only the tree like structure of the Quick Launch shortcuts is built to organize the available Quick Launch shortcuts, the order of display in the Quick Launch toolbar can be re-ordered in the Quick Launch toolbar directly.

   image

Previous Month  MAR  2013  Next Month
SMTWTFS
12
3456789
10111213141516
17181920212223
24252627282930
31

Previous Month  MAY  2013  Next Month
SMTWTFS
1234
567891011
12131415161718
19202122232425
262728293031

Sideway BICK Blog

27/03


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013