Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

VBSript recursion in function

Avatar of usslindstrom
usslindstromFlag for Japan asked on
ProgrammingScripting LanguagesVB Script
12 Comments1 Solution461 ViewsLast Modified:
Experts, if possible can I get a little nudge on a recursion item within vbscript?

I have a function that I need to call on itself to cycle through some data.

Without overloading anyone with too much info, I basically have a dictionary object, that is laid out like so:

Dictionary Key = Parent Object
Dictionary Value = Children, each separated by "\\"

arrNavChildren = fncGatherNavChildren(strNavKey, dicRelationshipParentToChild.Item(strNavKey))

Function fncGatherNavChildren(strNavKey, strNavItem)
   If dicRelationshipParentToChild.Exists(strNavKey) Then
      fncGatherNavChildren = Split(strNavItem, "\\")
      fncGatherNavChildren = ""
   End If
End Function

Basically, I need to see about having the function call itself on each pass, to see if there are more children to add to the array.  *If that makes sense.

So, it could be like this:

ParentA, ChildA\\ChildB\\ChildC
ChildB, SubChildA\\SubChildB...  and so on.

Would somebody happen to know where I can find information on how to accomplish this?  The Google Zhar hasn't been too helpful as of yet.