csteinhilber
Programmer
I have a ColdFusion 5 user-defined function (ie - written in CFSCRIPT) that recurses itself down a tree of data.
Everything is working great. 'cept now I have a need to add a loop within the function for other processing... and I'm trying to figure out how to handle it.
Example:
Problem is, since ColdFusion doesn't seem to have a concept of private vs. public variables... won't any values of #i# in the loop of the parent recursion get overwritten by values of #i# in the children??
I haven't actually coded it yet, but before I put a lot of work into it, I thought maybe someone had a pointer for accepted ways to handle such a situation. Or maybe it's not even an issue and everything would work just fine (though I really truly doubt it).
Thanks in advance!
-Carl
Everything is working great. 'cept now I have a need to add a loop within the function for other processing... and I'm trying to figure out how to handle it.
Example:
Code:
<CFSCRIPT>
function ProcessDataBranch(...){
if (somecondition EQ true){
:
for (i = 1;i LTE 5;i = i + 1){
myVar = myVar & ProcessDataBranch(...);
}
}
:
return myVar;
}
</CFSCRIPT>
Problem is, since ColdFusion doesn't seem to have a concept of private vs. public variables... won't any values of #i# in the loop of the parent recursion get overwritten by values of #i# in the children??
I haven't actually coded it yet, but before I put a lot of work into it, I thought maybe someone had a pointer for accepted ways to handle such a situation. Or maybe it's not even an issue and everything would work just fine (though I really truly doubt it).
Thanks in advance!
-Carl