Export (0) Print
Expand All
Expand Minimize

VariableValue Property

Visual Studio .NET 2003

Returns or sets the variable with the specified name.

[Visual Basic .NET]
Public Property VariableValue( _
   ByVal VariableName As String _
) As Object
[Visual Basic 6]
Property Get VariableValue( _
   ByVal VariableName As String _
) As Variant
Property Let VariableValue( _
   ByVal VariableName As String, _
   ByVal NewValue As Variant _
HRESULT __stdcall get_VariableValue(
   BSTR VariableName,
   /* [out, retval] */ VARIANT* retVal
HRESULT __stdcall put_VariableValue(
   BSTR VariableName,
   /* [in] */ VARIANT NewValue
public object VariableValue(
   string VariableName
) {get; set;}
[JScript .NET]
public function get VariableValue(
   VariableName : String
) : Object
public function set VariableValue(
   VariableName : String,
   NewValue : Object


Required. A string representing the name of the variable to retrieve.
Required. A variant representing the variable's value.


If you attempt to retrieve a variable that does not exist, the variable is created with an empty value. If you attempt to set a variable that does not exist, it is created with the specified value.


Private objSoln As Solution

Public Property prop(ByVal somestuff As String)
      objSoln.Globals.VariableValue("SampleProp") = somestuff
      objSoln.Globals.VariablePersists("SampleProp") = True
   End Get
   Set(ByVal SampleProp)
      If Not objSoln.Globals.VariableExists("SampleProp") Then
         objSoln.Globals.VariableValue("SampleProp") = ""
         objSoln.Globals.VariablePersists("SampleProp") = True
      End If
      SampleProp = objSoln.Globals.VariableValue("SampleProp")
   End Set
End Property

See Also

Applies To: Globals Object

© 2015 Microsoft