Skip to main content
Aug 20, 2006 10:07 PM UTC
Answered

creating variable via looped link

i am sending a url with a variable that is a modified series of variables

sublnk=SECID=2*SECTSUBID=2*SECTSUB1ID=90

i replaced the "&" with "*" because it is a sub variable in url string (i.e) sublnk=#sublnk#...? (please don't ask)

anyway when i get to the display page i need to split up and make variables of SECID, SECTSUBID, SECTSUB1ID

I tried a list loop:

<cfloop index="catzzz" list="#sublnk#" delimiters="*">
<cfset #catzzz#>
</cfloop>

what i want is:
<cfset SECID=2>, etc.

does not work.... ????

tnx in advance
    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer
    Aug 21, 2006 2:32 PM UTC
    Take a look at the attached code:

    3 replies

    Inspiring
    Aug 21, 2006 1:43 PM UTC
    I don't think CF allows this type of dynamic naming. You just need to split them up and so CF knows which part to treat as a string and which part to treat as an int.

    <cfset "#part1#" = #part2# >
    Translate
    Correct answer
    Aug 21, 2006 2:32 PM UTC
    Take a look at the attached code:
    Translate
    Aug 21, 2006 6:21 PM UTC
    ksmith,

    your code worked great but i modified a little to take remove some of the functions... see below.

    one thing i don't understand is how the variable can be read without making it dynamic with # sign as in

    <cfset "#varName#" = varVal>

    the variable "varVal" is dynamic.... it works but i don't get it. please explain.

    way thanks....

    ----------------------------------------------------------------------------------
    Translate