Cloud Posted October 16, 2006 Share Posted October 16, 2006 Tried to research it but no luck.. When I use a recursion and pass a variable over, Does the variable I pass over overwrite existing one? Example Func blah($blahBlah) // if $blahBlah=0 then return 0 else return $blahBlah+blah($blahBlah-1) endfunc So when Im in the xth loop, Is $blahBlah still the same memory location as $blahBlah when it was first called or is it its own variable as Java uses (Dont know c++ sorry just java). If its the same How would I solve this problem. I need to keep track of each variable and they need to be different. Thanks, Cloud Link to comment Share on other sites More sharing options...
Valuater Posted October 16, 2006 Share Posted October 16, 2006 (edited) it is still the same memory location if you use By-Reference Func blah(ByRef $blahBlah) 8) Edited October 16, 2006 by Valuater Link to comment Share on other sites More sharing options...
Uten Posted October 16, 2006 Share Posted October 16, 2006 I think your sample answers your question. Did you even consider to run it? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Cloud Posted October 16, 2006 Author Share Posted October 16, 2006 Didn't work as I wanted. Thats not the program Im making but Thats where Its coming from. So how would I Make each variable point to a different location? Array with a counter in the loop? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now