Hi,
I am making a faq page and questions and answers are stored in a record of a db.
I have this faqDS, but I can't find a way to avoid looping the ds 2x.
This is a problem I have seen before, needing to do something with one row of each collumn of ds, then something else with a diff row of each collumn.
Maybe this is bad data-design? but even splitting into two tables, I still have two loops.
I could store my info in an array
but now I actually have 3 loops. ^^
Any hints or tips are appriciated,
CJB
I am making a faq page and questions and answers are stored in a record of a db.
I have this faqDS, but I can't find a way to avoid looping the ds 2x.
Code:
for i = 0 to faqDS.tables(0).rows.count - 1
createQuestion(faqDS.tables(0).rows(i).item("question")
next i
for i = 0 to faqDS.tables(0).rows.count - 1
createAnswer(faqDS.tables(0).rows(i).item("answer")
next i
This is a problem I have seen before, needing to do something with one row of each collumn of ds, then something else with a diff row of each collumn.
Maybe this is bad data-design? but even splitting into two tables, I still have two loops.
I could store my info in an array
Code:
for i = 0 to faqDS.tables(0).rows.count - 1
allQuestions(i) = item("question")
allAnswers(i) = item("ansewer")
next i
but now I actually have 3 loops. ^^
Any hints or tips are appriciated,
CJB