[REBOL] Re: Creating stuff :)
From: stefan:falk:slg:se at: 26-Apr-2001 13:32
I have some POST-data from a CGI script, with a different number of
questions and answers every time, and I want to do this with the data (if
for example there are 2 questions and answers):
--------------------------------
question1: data/question1
answer1: data/answer1
question2: data/question2
answer2: data/answer2
append file-to-save question1
append file-to-save answer1
append file-to-save question2
append file-to-save answer2
-------------------------------
However, since there are a different number of questions depending on what
the user chose,
I would like to create a loop, I know the number of questions through a
value in the data like this:
number-of-questions: 2
and then I'd like to create a loop, but replace the Q and A numbers with a
counter, that, in my wild fantasy would look like this:
for count 1 number-of-questions 1 [
question[count]: data/question[count]
answer[count]: data/answer[count]
append file-to-save question[count]
append file-to-save answer[count]
]
But of course the [count] way doesn't work, is there any way to simply
replace a char in the code for variable?
/Regards Stefan Falk - www.amigaextreme.com