Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

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

Script, Scripting Language, VBScript elements, Server-Side VBScript Object Element FileSystemObject TextStream Method

VBScript Methods of FSO TextStream Object

Some typical predefined Elements are.

  • FSO Folder Object:
    • Copy Method
    • Delete Method
    • Move Method
    • CreateTextFile Method ≡ TextStream object

Close Method

last updated 12/16/2017

is to close the associated TextStream Object.

Syntax

fsostreamobjvar.Close( )

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.CloseRequired Keyword. to specify the Method of associated Object.

Remarks

  • The object is always the name of a TextStream object.

Applied to

TextStream Object

Read Method

last updated 12/16/2017

is to read a specified characters number of characters from a file of the associated TextStream Object, and to return the resulting string.

Syntax

fsostreamobjvar.Read(characters)

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.ReadRequired Keyword. to specify the Method of associated Object.charactersRequired. Number of characters you want to read from the file.

Applied to

TextStream Object

ReadAll Method

last updated 12/16/2017

is to read the entire file of the associated TextStream Object, and to return the resulting string.

Syntax

fsostreamobjvar.ReadAll( )

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.ReadAllRequired Keyword. to specify the Method of associated Object.

Remarks

  • For large files, using the ReadAll method wastes memory resources. Other techniques should be used to input a file, such as reading a file line by line.

Applied to

TextStream Object

ReadLine Method

last updated 12/16/2017

is to read an entire line (up to, but not including, the newline character) from from a file of the associated TextStream Object, and to return the resulting string.

Syntax

fsostreamobjvar.ReadLine( )

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.ReadLineRequired Keyword. to specify the Method of associated Object.

Remarks

  • The object argument is always the name of a TextStream object.

Applied to

TextStream Object

Skip Method

last updated 12/16/2017

is to skip a given characters number of characters when reading from a file of the associated TextStream Object.

Syntax

fsostreamobjvar.Skip(characters)

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.SkipRequired Keyword. to specify the Method of associated Object.charactersRequired. Number of characters to skip when reading a file.

Remarks

  • Skipped characters are discarded.

Applied to

TextStream Object

SkipLine Method

last updated 12/16/2017

is to skip the next line when reading from a file of the associated TextStream Object.

Syntax

fsostreamobjvar.SkipLine( )

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.SkipLineRequired Keyword. to specify the Method of associated Object.

Remarks

  • The object is always the name of a TextStream object.

Applied to

TextStream Object

Write Method

last updated 12/10/2017

is to send strings given str1, str2, …, and strN strings to the script debugger, followed by a newline character..

Syntax

Debug.Write([str1 [, str2 [, … [, strN]]]])

Argument

Debug.WriteRequired Keywords. The keywords used to specify the Source Property of the Err Object.([str1 [, str2 [, … [, strN]]]])Optionial. Strings to send to the script debugger.

Remarks

  • The Write method sends strings to the Immediate window of the Microsoft Script Debugger at run time. If the script is not being debugged, the Write method has no effect.
  • The Write method is almost identical to the WriteLine method. The only difference is that the WriteLine method sends a newline character after the strings are sent.

Requirement

3

Applied to

Debug Object

Write Method

last updated 12/16/2017

is to write a specified string to a file of the associated TextStream Object.

Syntax

fsostreamobjvar.Write(string)

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.WriteRequired Keyword. to specify the Method of associated Object.stringRequired. The text you want to write to the file.

Remarks

  • Specified strings are written to the file with no intervening spaces or characters between each string. Use the WriteLine method to write a newline character or a string that ends with a newline character.

Applied to

TextStream Object

WriteBlankLines Method

last updated 12/16/2017

is to write a given lines number of newline characters to a a file of the associated TextStream Object.

Syntax

fsostreamobjvar.WriteBlankLines(lines)

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.WriteBlankLinesRequired Keyword. to specify the Method of associated Object.linesRequired. Number of newline characters you want to write to the file.

Applied to

TextStream Object

WriteLine Method

last updated 12/10/2017

is to send given str1, str2, …, and strN strings to the script debugger, followed by a newline character.

Syntax

Debug.WriteLine([str1 [, str2 [, … [, strN]]]])

Argument

Debug.WriteLineRequired Keywords. The keywords used to specify the Source Property of the Err Object.([str1 [, str2 [, … [, strN]]]])Optionial. Strings to send to the script debugger.

Remarks

  • The WriteLine method sends strings, followed by a newline character, to the Immediate window of the Microsoft Script Debugger at run time. If the script is not being debugged, the WriteLine method has no effect.
  • The WriteLine method is almost identical to the Write method. The only difference is that the Write method does not send a newline character after sending the strings.

Requirement

3

Applied to

Debug Object

WriteLine Method

last updated 12/17/2017

is to write a given string and newline character to a file of the associated TextStream Object.

Syntax

fsostreamobjvar.WriteLine([string])

Argument

fsostreamobjvarRequired. to specify the associated Object instance reference.WriteLineRequired Keyword. to specify the Method of associated Object.stringOptional. The text you want to write to the file. If omitted, a newline character is written to the file.

Applied to

TextStream Object
Optional Element, Content Occurrence Character, Choice or sequence:(…)+one or more(…)*zero or more(…)?zero or one times(…)exactly once[…]optional(… | …)or( … & …)and( …, … )sequence⋯=⋯assign to⋯.⋯dot notation(+)include(-)exclude

Sideway BICK Blog

11/06


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