On Oct 23, 2006, at 03:44 UTC, Kirt Cathey wrote:

> In the company object, there is an array of companies.
> 
> I need to be able to recurse through the Company objects Companies
array and
> downstream.
> The answer is probalby in recursion, but still have not successfully
coded a
> recursion loop in RB that can read this kind of data, or similar data
(such
> as a TreeView).

Recursion isn't hard in RB (or any other modern language) but does take
a little getting used to.  It's also not always the best solution to
the problem.  But anyway, the recursive solution would look something
like:

 Sub ProcessCompany( c as Company )
   DoSomethingWith c
   for each subcompany As Company in c.subcompanies
      ProcessCompany subcompany
   next
 End Sub
 
Here of course I'm imagining that your array of companies within a
company is called "subcompanies."

HTH,
- Joe


--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to