troubleshooting Question

VBSript recursion in function

Avatar of usslindstrom
usslindstromFlag for Japan asked on
VB ScriptScripting LanguagesProgramming
12 Comments2 Solutions462 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

Open in new window

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.
Join our community to see this answer!
Unlock 2 Answers and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros