CreateTextFile in VBScript
Method: CreateTextFile
Description: Creates a specified file name and returns a TextStream object that can be used to read from or
write to the file
Use: Set objFile = objFolde.CreateTextFile(filename[, overwrite[, Unicode]])
Arguments: objFolder
Required. The name of a Folder Object previously instantiated.
filename
Required. A string expression that identifies the file to create
overwrite
Optional. Boolean value that indicates whether you can overwrite an existing file. The value is
True if the file can be overwritten, False if it can't be overwritten. If omitted, existing files are
not overwritten (default False).
unicode
Optional. Boolean value that indicates whether the file is created as a Unicode or ASCII file. If
the value is True, the file is created as a Unicode file. If the value is False, the file is created
as an ASCII file. If omitted, an ASCII file is assumed.
Array Functions in VBScript
Array Returns a variant containing an array
Filter Returns a zero-based array that contains a subset of a string array based on a filter criteria
IsArray Returns a Boolean value that indicates whether a specified variable is an array
Join Returns a string that consists of a number of substrings in an array
LBound Returns the smallest subscript for the indicated dimension of an array
Split Returns a zero-based, one-dimensional array that contains a specified number of substrings
UBound Returns the largest subscript for the indicated dimension of an array
Define Trace Switches
Define Trace Switches.
Trace switches are used to configure tracing behavior.
There are two kinds of trace switches: BooleanSwitch and TraceSwitch.
BooleanSwitch: It is either on or off.
TraceSwitch : It has property to determine trace behaviour.
Trace switches can be configured through application's .config file even after the application is compiled.
What are Trace switches?
Trace switches are used to enable, disable and filter the tracing output. They are objects can be configured through the .config file.
Explain how to implement properties.
You can either use fields or property procedure to add properties.
It is convenient to use fields when the values associated with the properties are less in number. eg: boolean which can have only two values associated with it.
If property procedure has to be used to add a property, then three steps need to be followed:
- Declare a private variable to store the value of the property
- Write a get procedure to retrieve the value of the variable and
- Write a set procedure to set the value of the variable.