A hearty thanks to all of you who spent time looking at my issue, even if
you didn't reply.
I had assumed that when a function was invoked that it ran in its own
'space', and that all variables were just magically local to that
invocation. But thanks to input from you all, and I do mean all, I was shown
the light. Anywho, pasted below is the working function, beautiful in its
simplicity.
<cfscript>
function showtree(thiskey,level){
var thisquery="";
var i = 0;
var thislevel = level+1;
writeoutput(repeatstring("-",level) & thiskey & "-" & thislevel & "<br>");
thisquery = cfquery("select * from pResults where supervisor_id = '" &
thiskey & "'");
if(thisquery.recordcount gt 0){
for (i=1; i lte thisquery.recordcount; i=i+1){
showtree(thisquery.personid[i],thislevel);
}
thislevel = thislevel-1;
}
if(thislevel eq 0){
return;
}
}//end of function
</cfscript>
_________________________________________________________________
Get tips for maintaining your PC, notebook accessories and reviews in
Technology 101. http://special.msn.com/tech/technology101.armx
=========================================================
Kansas City ColdFusion User Group's website & listserv is
hosted through the generous support of Clickdoug.com
To send email to the list, email [EMAIL PROTECTED]
To (un)subscribe, email [EMAIL PROTECTED] with your request.
For hosting solutions http://www.clickdoug.com
Featuring Win2003 Enterprise, RedHat Linux, CFMX 6.1.
======================================================
- [KCFusion] recursive function help needed doug boude
- RE: [KCFusion] recursive function help needed Bruce Dunwiddie
- RE: [KCFusion] recursive function help needed doug boude
- RE: [KCFusion] recursive function help needed Bruce Dunwiddie
- RE: [KCFusion] recursive function help needed Ellis, Randy
- doug boude
