View Single Post
 
Old April 26th, 2005, 07:50 AM
DolphinBay DolphinBay is offline
Authorized User
 
Join Date: Dec 2003
Location: , , .
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to DolphinBay
Default

Peter,

Thank you for the explanation... after looking at the function for a while I am starting to grasp the concepts around recursion. Like you said, it is not exactly the easiest logic to get your arms around.

I am running into a problem when trying to populate the sets with dynamic data retrieved from a SQL Table. When I hard code the data into the jagged array, everything works fine. However, when I try to dynamically populate the data, it is not recursing through the information. Below is my code:

Dim sOptDtls As String = ""

'BUILD STRING TO INCLUDE IN JAGGED ARRAY
For Each dra In ds.Tables("option_details").Rows
   sOptDtls &= dra.Item("styleOptDtl_id") & ","
Next

'REMOVE TRAILING COMMA FROM STRING
sOptDtls = Left(sOptDtls, Len(sOptDtls) - 1)

'ADD STRING OF DETAILS TO aOptData
     aOptData(i) = New String() {sOptDtls}

When I check the first value in the array it is returning the entire string, rather than just the first value:
aOptData(0)(0) = "1,2,3"

Where if I hard code the data:
     aOptData(i) = New String() {1,2,3}

The first value would be returned as:
aOptData(0)(0) = "1"

Any ideas? Is it a datatype issue?

Many thanks again,
Eric


Dolphin Bay, Inc. -- turning visions into eReality(tm) -- West Palm Beach, FL
Website Design, Internet Strategy, Search Engine Marketing

www.dphin.com