Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable of variable

Status
Not open for further replies.

obouillaud

Programmer
Dec 13, 2000
9
0
0
FR
I need help on that subject.

I would like to make the following thing

<CFSET I=0>

<CFOUTPUT QUERY=...>

<CFSET var_#i#=#name of the field#>

<CFSET i=i+1>
</CFOUTPUT>

but it doesn't work.

how can i use a variable of variable ?

thanks in advance

Yes I'm french,

Olivier (obouillaud@mircoapp.com) <-- if u can answer to this adress it will be great.


 
thread232-28372 - should help !!

ps : desolee de t'avoir grille mais c t trop facile ;]

 
Interesting, I wasn't aware of the setVariable() function. I've just always used <cfset &quot;var#x#&quot; = &quot;value#x#&quot;> to do this.

GJ
 
setvariable is usefull but after that, how can i manipulate the variable ???

i cant use <IF var#i# ...>
cant use
<CFOUTPUT query=&quot;..&quot;>
var#i#
</CFOUTPUT>

...

so... thats not so usefull :-( so ... if u can help me ..

Olivier
 
you have to evaluate(var i)
check in the docs for the exact syntax
but it should finally look like this : <cfif #evaluate(&quot;#..
 
<CFSET temp =&quot;#tabl_thema[arraylen(tabl_thema)][1]#&quot;>
<CFSET temp2 = #evaluate(&quot;#temp#&quot;)#>
<CFIF form.#temp2# EQ &quot;yes&quot;>#thematique# a été sélectionnée.</CFIF>

toute bidouille de quelque type que ce soit me renvoit une erreur.
form.une_variable ne veut jamais fonctionner !!!

Olivier
 
-> essaie de faire un cfoutput de temps2 apres la 2eme ligne, tu dois avoir la bonne valeur dedans
-> dans la 3eme ligne, d'une c'est #form.temp2# et pas form.#temp2#; de deux temp2 tu l'as defini dans un cfset c'est donc sur qu'il vient pas d'une form !!!!!

for english users that might be interested in knowing more ;-)
-> temp2 after the 2nd line should be correct. <cfoutput>#temp2#</cfoutput> should display the correct value.
-> the problem(s) is(are) in the 3rd line :
* it's #form.temp2# or #temp2# but certainly not what is written !!
* what's more, temp2 does not come from a form (it has just been created on the above line) so you'll never ever get a value using form.temp2 !!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top