VariableValue
ID
Top
TOC
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

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 _
) 
[C++]
HRESULT __stdcall get_VariableValue(
   BSTR VariableName,
   /* [out, retval] */ VARIANT* retVal
);
HRESULT __stdcall put_VariableValue(
   BSTR VariableName,
   /* [in] */ VARIANT NewValue
);
[C#]
public object VariableValue(
   string VariableName
) {get; set;}
[JScript .NET]
public function get VariableValue(
   VariableName : String
) : Object
public function set VariableValue(
   VariableName : String,
   NewValue : Object
)

Parameters

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

Remarks

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.

Example

Private objSoln As Solution

Public Property prop(ByVal somestuff As String)
   Get
      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

Show:
© 2016 Microsoft