SMILE.COM GetAllNodes

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

SMILE.COM GetAllNodes

Post by jdtoellner » Sun Mar 11, 2018 5:01 pm

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 » Mon Mar 12, 2018 6:13 pm

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: 1270
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE.COM GetAllNodes

Post by shooltz[BayesFusion] » Mon Mar 12, 2018 6:25 pm

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 » Mon Mar 12, 2018 11:28 pm

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