OnlineVariables.CreateOnlineVariables



CreateOnlineVariables(Name As String) As OnlineVariable

Parameters

Name As String
Unique name of the online variable. This name can be transferred to the method Item of the collection as a parameter to get the object from the collection.
ED
not used
RT
avaliable

Remarks

Creates a new object OnlineVariable and returns it. The newly created object is linked to the key strName. With this key the object can be found in the collection at any time.
If an online variable with the same name already exists, Nothing is returned. Therefore the newly created object should be checked on Nothing in any case.

Sample:


Dim WithEvents zOLV As OnlineVariable
Const strOLV As String = "MyOnlineVariableContainer"

'initialize event on runtime startup
Private Sub Project_Active()
	'get object if already exists
	Set zOLV = thisProject.OnlineVariables.Item(strOLV)
	If zOLV Is Nothing Then
		'if not exitst, create a new OnlineVariable container
		Set zOLV = thisProject.OnlineVariables.CreateOnlineVariables(strOLV)
		'add variables to the container
		zOLV.Add "Variable1"
		zOLV.Add "Variable2"
		zOLV.Add "Variable3"
	End If
	'activate 'VariableChange' event
	zOLV.Define
End Sub

See Also

OnlineVariables, OnlineVariable