Thanks for that Rich, actually just found out that I don't need this script
now but this sort of stuff is still useful to know!
Giles
----- Original Message -----
From: "Rich Wild" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 01, 2002 10:06 AM
Subject: RE: [ cf-dev ] Lists of lists and cfscript
you've got two problems.
the first, looping in cfscript:
the syntax is this
for (i=1;i lte 10;i=i+1) {
writeoutput('i = ' & i & '<br>');
}
so for your list you would do this:
for (i=1; i lte listlen(mylist);i=i+1) {
writeoutput('listpair = ' & listgetat(mylist, i) & '<br>');
}
as for your incoorect number of list elements, you should avoid using commas
to separate the tag pairs, as the list functions are picking up on the
commas and thinking they're part of the main list. Use somethign like �
instead.
eg
<cfset tagPairList = "'<td�</td','<tr�</tr','<table�</table'">
then loop over the main list using the default comma as the delimiter, then
loop over the inner list using � as the delimiter.
Rich
> -----Original Message-----
> From: Giles Roadnight [mailto:[EMAIL PROTECTED]]
> Sent: 01 October 2002 10:14
> To: [EMAIL PROTECTED]
> Subject: [ cf-dev ] Lists of lists and cfscript
>
>
> Morning All
>
> I am writing a script to check that a string has the same
> number of start
> and end td, tr and table tags. I am wanting to write this in
> cfscript and I
> want to have all of the tags in a list so that more can be
> added if needed
> and I don't have to write the same bit of code for each tag pair.
> So how do I get a list of lists? I have this
>
> <cfset tagPairList = "'<td,</td','<tr,</tr','<table,</table'">
>
> but if I loop through this list I get six results not 5 and
> how do I do a
> cfloop in cfscript. I know about doing for loops but doing a
> for loop over a
> list is harder than cflooping over a list.
>
> I know there are ways around these problems but I was just
> wondering if this
> sort of thing is possible.
>
> Thanks
>
> Giles
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]