ahem...  tested my code....  It didn't quite work the way I anticipated,
so here's a minor rewrite with the addition that I change the <br> list
delimiters to |   Also, it checks to make sure that you do have a value
before trying to getting it from thisPair.

<cfscript>
yourvar = ReplaceNoCase("var1=sometext<br> var2=<br>
var3=9999999<br>var4=sometext","<BR>","|","ALL");
valuecount = listlen(yourvar,"|");
valuestruct = structnew();
writeoutput(yourvar&"<br>");
for (i=1; i lte valuecount; i=i+1) {
    thisPair = ListGetAt(yourvar,i,"|");
    writeoutput(thisPair&"<br>");
    thisVariable = trim(ListFirst(thisPair,"="));
    if (ListLen(thisPair,"=") EQ 2) thisValue =
trim(ListGetAt(thisPair,2,"="));
    else thisValue ='';
    valuestruct[thisVariable] = thisValue;
}
</cfscript>

<cfdump var="#valuestruct#">

Works much better. :o)

Stephen
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to