Iteration variables
hello I'm writing a recursive function, and I need to hold variables relative to each iteration of the function... Which may have been changed further on down/up the line by another calling of the function So I need to hold values for each iteration How do you do this?! TIA, Ryan [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Iteration variables
Probably a list or array would be easiest. (If I understand correctly)Just look for the value in the nth place in the list/array. John Burns -Original Message- From: Ryan Mitchell [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2003 12:59 PM To: CF-Talk Subject: Iteration variables hello I'm writing a recursive function, and I need to hold variables relative to each iteration of the function... Which may have been changed further on down/up the line by another calling of the function So I need to hold values for each iteration How do you do this?! TIA, Ryan _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Iteration variables
Just make sure it's a 'var' variable, and it'll be local to that specific function invocation.That's one of the big reasons recusion is so elegant. You can't easily get that type of controlled variable scoping with iterative solutions. Cheers, barneyb -Original Message- From: Ryan Mitchell [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2003 9:59 AM To: CF-Talk Subject: Iteration variables hello I'm writing a recursive function, and I need to hold variables relative to each iteration of the function... Which may have been changed further on down/up the line by another calling of the function So I need to hold values for each iteration How do you do this?! TIA, Ryan [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]