SMILE.COM GetAllNodes

The engine.
Post Reply
jdtoellner
Posts: 71
Joined: Mon Aug 01, 2016 9:45 pm

SMILE.COM GetAllNodes

Post by jdtoellner »

Can you show me how the SMILE.COM GetAllNodes method works?
jdtoellner
Posts: 71
Joined: Mon Aug 01, 2016 9:45 pm

Re: SMILE.COM GetAllNodes

Post by jdtoellner »

I figured it out.

Code: Select all

Sub GetNodes()

	Dim Nodes As Variant
	
	Nodes = Net.GetAllNodes()

End Sub
This assumes you already had opened a network.

Code: Select all

Dim Net As SmileNetwork		'Has to be accessible to the function below

Set Net = New SmileNetwork

Net.ReadFile("Network.xdsl")
shooltz[BayesFusion]
Site Admin
Posts: 1314
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE.COM GetAllNodes

Post by shooltz[BayesFusion] »

The following will work as well:

Code: Select all

Dim a
a = Net.GetAllNodes()
To iterate over the array, you can use LBound and UBound:

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
jdtoellner
Posts: 71
Joined: Mon Aug 01, 2016 9:45 pm

Re: SMILE.COM GetAllNodes

Post by jdtoellner »

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
Post Reply