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!

Joining Variables...(sort of)

Status
Not open for further replies.

beejay58

Technical User
Sep 11, 2003
12
0
0
NZ
I hope I explain this properly...

I have an number of variables being passed to a CF page. These are named TITLE1 - TITLEx (x being the total number of variables being passed - this varies). An array is NOT being used, the values are all separate (this bit is out of my control). However, the value of x is passed to the next page.

I want to process these variables in a loop but am having trouble defining - or extracting each separate value.

For instance:

Lets say the value of x is 9. I have variables TITLE1 thru TITLE9 passed to the next page and I want to create a loop (ctr= 1 to x) and extract each value for processing or reassigment to another variable or array. I have tried the following:

<CFSET newvar = 'TITLE#ctr#'>
<CFSET newvar = '"TITLE"#ctr#'>
<CFSET newvar = 'TITLE & #ctr#'>
<CFSET newvar = '"TITLE" & #ctr#'>

and lots of others similar to no avail.

I hope this is clear and I am sure it is possible. All ideas greatly appreciated.

Beejay
 
try

<CFSET newvar = evaluate('TITLE'&#ctr#)>

thereptilian120x120.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top