VarSpace
|
Description:This class is designed to simplify the storage and retrieval of Variable objects. Variable values may be stored and retrieved with the Value properties or the backward compatible SetValue/GetValue methods. References to the Variable objects may be retrieved through the GetVariable method.
Variable tracing is also available at this level.Author:
Andrew FriedlCopyright:
History:
Copyright 1997.04.10, BlackBox Software & Consulting
- 2000.03.15, Implemented new event model.
Variables | |
Private | |
mCol |
As Collection |
General Methods
object members |
|
Item
|
Public Property Get Item(vntIndexKey As Variant) As Variable
Collection based retrieval |
Count
|
Public Property Get Count() As Long
Collection based object count |
NewEnum
|
Public Property Get NewEnum() As IUnknown
Collection based enumeration |
Value
|
Public Property Get Value(Name As String) As Variant
Retrieves a named value from the collection. |
Value
|
Public Property Let Value(Name As String, Value As Variant)
Stores a named value (non object) to the collection. |
Value
|
Public Property Set Value(Name As String, Value As Variant)
Stores a named value (object) to the collection. |
Storage
|
Public Property Get Storage() As Collection
Returns the collection storage for the variable set. |
GetVariable
|
Public Function GetVariable(Name As String, Value As Variable) As Boolean
Locates a named Variable object. |
SetValue
|
Public Function SetValue(Name As String, Value As Variant, Optional ReadOnly As Variant) As Boolean
Sets or creates a named variable within the collection. |
GetValue
|
Public Function GetValue(Name As String, Value As Variant) As Boolean
Retrieves a named value from the collection. |
SetTrace
|
Public Function SetTrace(Name As String) As VarTrace
Adds tracing to a named variable. |
Remove
|
Public Sub Remove(vntIndexKey As Variant)
Collection based deletion |
Class_Initialize
|
Private Sub Class_Initialize()
Class Constructor |
Class_Terminate
|
Private Sub Class_Terminate()
Class Destructor |
Clear
|
Public Sub Clear()
Removes all variables form the collection. |
EndAllTraces
|
Private Sub EndAllTraces()
Terminates all tracing within the collection. |
General Methods - Detail
object members |
Collection based retrieval
Definition:
Public Property Get Item(vntIndexKey As Variant) As Variable
Collection based object count
Definition:
Public Property Get Count() As Long
Collection based enumeration
Definition:
Public Property Get NewEnum() As IUnknown
Retrieves a named value from the collection.
Description:
This function retrieves the value of a named variable, assuming the variable exists.Definition:
Public Property Get Value(Name As String) As Variant
Parameters: Name The name of the variable whose value is to be retrieved. Returns:
The value of the variable.
Stores a named value (non object) to the collection.
Description:
This function stores a new non-object value to the collection or updates an existing variable with a given name. If the variable exists, an attempt is made to update it, otherwise it is created.Definition:
Public Property Let Value(Name As String, Value As Variant)
Parameters: Name The name of the variable whose value is to be retrieved. Value The value of the variable to be updated or stored.
Stores a named value (object) to the collection.
Description:
This function stores an object value to the collection or updates an existing variable. If the variable exists, an attempt is made to update it, otherwise it is created.Definition:
Public Property Set Value(Name As String, Value As Variant)
Parameters: Name The name of the whose value is to be retrieved. Value The value of the variable to be updated or stored.
Returns the collection storage for the variable set.
Definition:
Public Property Get Storage() As Collection
Returns:
A Collection of Variable objects.
Locates a named Variable object.
Description:
This function seaches for and retreves a reference to a named Variable contained within the collection.Definition:
Public Function GetVariable(Name As String, Value As Variable) As Boolean
Parameters: Name The name of the variable to be located. Value The reference that is to be set if the variable is found. Returns:
True if the Variable is located, False otherwise.
Sets or creates a named variable within the collection.
Description:
This function sets or creates a named value within the collection. If a value with the Name specified already exists, then it an attempt is made to update it to the new value. If no value exists then a new Variable is created with the value specified.Definition:
Public Function SetValue(Name As String, Value As Variant, Optional ReadOnly As Variant) As Boolean
Parameters: Name The name of the variable to be created or set. Value The value to be stored or updated. ReadOnly An optional parameter indicating the value os to be readonly. This parameter is only meaningful when a variable is first created. Returns:
True if the Variable is created or updated, False otherwise.
Retrieves a named value from the collection.
Description:
This function retrieves the value of a named variable and stores that value in the Value parameter, provided the variable exists.Definition:
Public Function GetValue(Name As String, Value As Variant) As Boolean
Parameters: Name The name of the variable whose value is to be retrieved. Value The variant where the value is to be stored. Returns:
True if the Variable exists, False otherwise.
Adds tracing to a named variable.
Description:
This function creates a trace upon a variable contained within the collection, provided the variable exists.Definition:
Public Function SetTrace(Name As String) As VarTrace
Parameters: Name The name of the variable to be traced. Returns:
A VarTrace object capable of generating events.
Collection based deletion
Definition:
Public Sub Remove(vntIndexKey As Variant)
Class Constructor
Definition:
Private Sub Class_Initialize()
Class Destructor
Definition:
Private Sub Class_Terminate()
Removes all variables form the collection.
Description:
This subroutine causes all variables within the collection to be deleted. All variable traces in effect will receive event notifications prior to deletion.Definition:
Public Sub Clear()
Terminates all tracing within the collection.
Description:
This subroutine removes all tracing from the variables contained within the collection.Definition:
Private Sub EndAllTraces()