Overview of Properties

Related Topics

A property is a unique attribute of an object that you can return or set. To refer to a property, use the following dot syntax:

object.property

Some properties take arguments, which you enclose within parentheses as follows:

object.property (arg1,arg2,...)

By setting the values of an object's properties, you change the object's characteristics. For example, you can use the ColorScheme property of the Session object to change a session's color scheme association. The following statement sets the color scheme to "Blue Sky."

Set Session.ColorScheme = "Blue Sky"

You can determine the current color scheme of the session object as well as set it. The following statement returns the current value of the ColorScheme property and displays it.

MsgBox Session.ColorScheme

Properties that you can both set and return, like ColorScheme, are read-write properties. Properties whose values can only be returned are read-only properties. Most of the System object's properties are read-only. For example, you can return the values of the ActiveSession, Version, and Application properties, but you cannot change their values.

Properties that Return Objects

The value of most properties is either an integer, a character string, or a Boolean value. However, some properties return an object. In the statement below, Ses1.Screen returns a reference to a Screen object. Ses1 is an object variable that references a Session object; Screen is a Session object property. The Set statement assigns the returned Screen object reference to the object variable SessionScreen.

Set SessionScreen = Ses1.Screen

In the next statement, Extra.ActiveSession.Close, the Session object that currently has the focus is closed. Extra is an object variable that references the System object; ActiveSession is a property of the System object that returns the Session object that currently has the focus. The Close part of the expression is a method of the Session object.

Extra.ActiveSession.Close

Default Properties

Every object has a default property, that is, a property that does not have to be explicitly stated in an expression. For example, the Name property is the default for the Session object. The following two statements both return the name value for a Session object referred to as Ses1.

SesName = Ses1.Name

-or-

SesName = Ses1