Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
JHCOLVI #1
Assign Array with Dynamic Variable Names
I have an 2 dimensional array that I want to assign to an 1 dimensional array
with a dynamic Variable Name. I can set the newarray function, but I can not
get the syntax right to assign the array:
2d array - flag [element1] [element2]
code:
<cfset "flag_#element1#[#element2#]"=0>
element1 is assign from a list and element2 is assign from looping thru a
recordcount.
Coldfusion gives me the following error:
Invalid CFML construct found on line 259 at column 82.
ColdFusion was looking at the following text:
[
JHCOLVI Guest
-
Dynamic variable names??? Please Help!
So I'm making this application for accessing research data - lots of different data tables, each with it's own data columns. I have made the... -
Getting the best answer(WAS: How do you dynamically assign array names?)
I think this touches on an issue that people should consider when they post to this list. Often people ask a question, and instead of asking for... -
How do you dynamically assign array names?
Hi, I am trying to initialize a dynamically-named array, i.e. with the following test code (if I type "script.pl char" at the command prompt) I... -
Dynamic Variable Names
I have a shopping cart page that allows a user to type in a new quantity and press a button. The quantities entered are in form text boxes with... -
assign a variable using reflection
Hallo, I am trying to assign a variable using reflection, Does anyone know how this is done? Any suggestions would be appriciated.. ... -
MikerRoo #2
Re: Assign Array with Dynamic Variable Names
What happens when you try:
<cfset flag [element1] [element2] = 0>
You might also add the following to your code (above this line) and post the
results here:
<CFDUMP var="#element1#">
<CFDUMP var="#element2#">
<CFDUMP var="#flag#">
Regards,
-- MikeR
MikerRoo Guest
-
JHCOLVI #3
Re: Assign Array with Dynamic Variable Names
I can run the 2d array fine, but I am finding that it takes a long time to run
and it is almost impossible to get a cfdump of the 2d array. That is why I want
to change it to a 1d array with a dynamic variable name. It runs faster and I
can get a cfdump fine. But I am having problem getting the syntax right.
JHCOLVI Guest
-
MikerRoo #4
Re: Assign Array with Dynamic Variable Names
I'm sorry but there is not enough information here to help you.
Can you post a sample of the existing data and the desired result. And/ Or
post the code that creates and sets "flag", "element1", and "element2".
And/Or post the requested dumps.
Regards,
-- MikeR
MikerRoo Guest



Reply With Quote

