Property: Value for ContextParameter
- Updated2024-09-12
- 2 minute(s) read
DIAdem NAVIGATOR > Properties > Property: Value for ContextParameter
Property: Value for ContextParameter
Specifies the value of a context parameter.
Object.Value
| Object | ContextParameter Object with this property |
| Object.Value | Variant with read and write access |
The following example generates several context parameters and writes these parameters to an ASAM server:
| VBScript | Python |
Dim oMyDataStore Set oMyDataStore = Navigator.ConnectDataStore("MyASAMServer") 'Generating parameter set Dim oMyParameterSet Set oMyParameterSet = Navigator.Settings.CreateContextParameterSet oMyParameterSet.Name = "MyParameterSet" 'Generating parameters and writing parameters into parameter set Dim OMyParameters Set oMyParameters = oMyParameterSet.Parameters Call oMyParameters.Add("DoubleParameter",1.2345,DataTypeFloat64) Call oMyParameters.Add("StringParameter","Parameter",DataTypeString) 'Reading all parameters from parameter set Dim MyParameter For Each MyParameter in oMyParameterSet.Parameters Call MsgBoxDisp("Name: " & MyParameter.Name & VBCrLf _ & "Value: " & MyParameter.Value & VBCrLf _ & "Data type: " & MyParameter.DataType) Next 'Saving, removing and loading parameter set Call Navigator.Settings.SaveContextParameterSet("d:\MyParameterSet.tdp",oMyParameterSet) oMyParameterSet.Parameters.RemoveAll Set oMyParameterSet = Navigator.Settings.LoadContextParameterSet("d:\MyParameterSet.tdp") 'Writing parameter set to server Dim oContext Set oContext = oMyDataStore.GetContext Call oContext.SetParameters(oMyParameterSet) 'Writing another single parameter to server Call oContext.SetParameter("AnotherParam","ParamValue",DataTypeString) 'Reading single parameter from server Dim MyValue MyValue = oContext.GetParameter("AnotherParam")