RE: Recursion and Scope problem?

2003-09-18 Thread Hagan, Ryan Mr (Contractor ACI)
Try using the var keyword in your first four cfset statements. cfset var root_node = Arguments.node cfset var levels = ... -Original Message- From: Cedric Villat [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 12:59 PM To: CF-Talk Subject: Recursion and Scope problem? Ok,

RE: Recursion and Scope problem?

2003-09-18 Thread Ian Skinner
Because you where using the default scope that can be seen by default all functions can see. The Var keyword declares the scope private to the function alone. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA -Original Message- From: Cedric

RE: Recursion and Scope problem?

2003-09-18 Thread Hagan, Ryan Mr (Contractor ACI)
As I understand it ( and I'll be quickly corrected if I'm wrong ), here's how scope works. In a CF page, all variables on that page (and cfinclude'd pages) have the same Global scope...functions included. By using the var keyword, you're telling CF to make the declared variable private scope of

RE: Recursion and Scope problem?

2003-09-18 Thread Andre Turrettini
basically, you call the function once and the vars are declared in the global scope, when that function calls itself, it redeclares them again in that same global scope, so they are overwritten. So, when the top function continues, its variables are no longer the ones it set. Using the var