Dart SNMP Library 4.0
CreateVariable Method
Value to populate the Variable with.
Table row indexer.
Description
Returns an initialized Variable.
Syntax
Visual Basic
Public Function CreateVariable( _
   Optional ByVal val As Variant, _
   Optional ByVal rowIndexer As String = "" _
) As Variable
Parameters
val
Value to populate the Variable with.
rowIndexer
Table row indexer.
Return Value
rowIndexer is only used if MibNode.Usage is usageTableColumn.
Example
Demonstrates creating a Variable with a value and adding it to the agent's variables collection.
Private Sub StartAgent(localAddress As String)
    'Populate a variable on the agent
    Agent1.Variables.Add Agent1.Mib.Nodes("sysDescr").CreateVariable("System Description")
    'Establish local binding address
    Dim localEP As New IPEndPoint
    localEP.NameOrAddress = localAddress
    localEP.Port = 161
    'Start agent on the specified local binding address
    Agent1.Start localEP, True
End Sub

Private Sub Agent1_Request(ByVal requestMessage As DartSnmpCtl.ISnmpMessage)
    Agent1.SendResponse Agent1.CreateResponse(requestMessage), requestMessage.Origin
End Sub
See Also

MibNode Object  | MibNode Members


PowerSNMP for ActiveX Documentation Version 4.0
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic