Property archives - The VBScript Network and Systems Administrator's Cafe

The VBScript Network and Systems Administrator's Cafe:

Property

Sep 20 2008   8:10PM GMT

VBScript Statements: Explanation of the Property Get Statement



Posted by: Jerry Lees
VBScript Statements, Property, Property Get

Within a VBScript class the Property block allows you to Get the value of the property in the class. This statement works in conjunction with the Property Let and Property Get statements and can only be used inside a class inside VBScript– and no where else in the script.

 By default the Property Get statement is public but you can declare it to be private if you need to do so. Since this statement is used in a block, it is required that you end the block with the End Property statement. This statement works a little differently than the other two property statements, however, because it returns a value. The returning of a value works very much like a function, in that, you set the Name of the property to the value you want to return.

The block of code will look something like this:

Property Get PropertyName

 ’ code goes here
ProptertyName = value

End Property

Sep 19 2008   7:50PM GMT

VBScript Statements: Explanation of the Property Set Statement



Posted by: Jerry Lees
VBScript, VBScript Statements, Property, property set

Within a VBScript class the Property block allows you to set the value of the property in the class. This statement works in conjunction with the Property Let and Property Get statements and can only be used inside a class inside VBScript– and no where else in the script.

This would in turn be called in VBScript in your function after you create an instance of the class like so:

InstanceOfClass.PropertyName.Set (args)

 By default the Property Set statement is public but you can declare it to be private if you need to do so. Since this statement is used in a block, it is required that you end the block with the End Property statement. The block of code will look something like this:

Property Set PropertyName

 ’ Property setting code goes here

End Property


Sep 18 2008   7:31PM GMT

VBScript Statements: Explanation of the Property Let Statement



Posted by: Jerry Lees
VBScript, VBScript Statements, Classes, Property, Property Let

Within a VBScript class the Property block allows you to set the name of the property in the class. This statement works in conjunction with the Property Set and Property Get statements and can only be used inside a class inside VBScript– and no where else in the script.

 By default the Property Let statement is public but you can declare it to be private if you need to do so. Since this statement is used in a block, it is required that you end the block with the End Property statement. The block of code will look something like this:

Property Let PropertyName

 ’ code goes here

End Property