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
> -----Original Message-----
> From: Joel Neely [mailto:[EMAIL PROTECTED]]
> Sent: den 26 april 2001 13:26
> To: [EMAIL PROTECTED]
> Subject: [REBOL] Re: Creating stuff :)
>
>
> I guess I'm unclear what you're trying to do. Did you mean the
> square brackets as metalanguage, or were you trying to manipulate
> the contents of an array of counters?
>
> -jn-
>
> [EMAIL PROTECTED] wrote:
> >
> > Hi,
> > the closest I've come to solving this is to print out
> everything in to a
> > file and "do" the file, but there has to be a better solution?
> >
> > > Hi,
> > > I'm not quite sure what you mean with this,
> > >
> > > The line it should replace (if count = 1) is:
> > >
> > > question1: data/question1
> > >
> > > > From: Andrew Martin [mailto:[EMAIL PROTECTED]]
> > > > Sent: den 25 april 2001 00:11
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [REBOL] Re: Creating stuff :)
> > > >
> > > >
> > > > Stefan wrote:
> > > > > question[count]: data/question[count]
> > > >
> > > > Try:
> > > > poke question count data/question/:count
> > > >
> > > > I hope that helps!
> > > >
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.