SMILE.COM GetAllNodes
-
- Posts: 71
- Joined: Mon Aug 01, 2016 9:45 pm
SMILE.COM GetAllNodes
Can you show me how the SMILE.COM GetAllNodes method works?
-
- Posts: 71
- Joined: Mon Aug 01, 2016 9:45 pm
Re: SMILE.COM GetAllNodes
I figured it out.
This assumes you already had opened a network.
Code: Select all
Sub GetNodes()
Dim Nodes As Variant
Nodes = Net.GetAllNodes()
End Sub
Code: Select all
Dim Net As SmileNetwork 'Has to be accessible to the function below
Set Net = New SmileNetwork
Net.ReadFile("Network.xdsl")
-
- Site Admin
- Posts: 1422
- Joined: Mon Nov 26, 2007 5:51 pm
Re: SMILE.COM GetAllNodes
The following will work as well:
To iterate over the array, you can use LBound and UBound:
Code: Select all
Dim a
a = Net.GetAllNodes()
Code: Select all
Dim a
a = s.GetAllNodes()
for i = LBound(a) to UBound(a)
dim nodeid as string
nodeid = a(i)
rem do something with nodeid
next
-
- Posts: 71
- Joined: Mon Aug 01, 2016 9:45 pm
Re: SMILE.COM GetAllNodes
Here's another way to iterate over an array:
Code: Select all
Sub DisplayNodes()
Dim Nodes As Variant
Dim Node As Variant
Range("A1").Select
Nodes = Net.GetAllNodes()
For Each Node in Nodes
ActiveCell.Value = Node
ActiveCell.Offset(1,0).Select
Next Node
End Sub