danielkza Posted January 31, 2008 Share Posted January 31, 2008 Does anybody know how can i get a variable name as a string?I've found IsDeclared,Eval,etc,but i haven't found a way to recover the var name to use with them. Thank you. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 31, 2008 Share Posted January 31, 2008 Does anybody know how can i get a variable name as a string?I've found IsDeclared,Eval,etc,but i haven't found a way to recover the var name to use with them.Thank you.Recover the var name...? What exactly are you trying to accomplish? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
danielkza Posted January 31, 2008 Author Share Posted January 31, 2008 Recover the var name...? What exactly are you trying to accomplish? I'm trying to make an multidimensional ArrayAdd,using Execute() to ReDim it so i can do it with any number of dimensions. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 31, 2008 Share Posted January 31, 2008 I'm trying to make an multidimensional ArrayAdd,using Execute() to ReDim it so i can do it with any number of dimensions.I don't get it. If the array is passed to the fucntion ByRef, you only need the local name inside the function. If the array is passed ByVal, then you only need to know the local name of the parameter that received it, then Return it. Why do you need the original variable name inside your function? What requires calling the function from Execute()? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
weaponx Posted January 31, 2008 Share Posted January 31, 2008 I don't get it. If the array is passed to the fucntion ByRef, you only need the local name inside the function. If the array is passed ByVal, then you only need to know the local name of the parameter that received it, then Return it. Why do you need the original variable name inside your function? What requires calling the function from Execute()? You have to use Execute to account for a large number of dimensions, due to the lack of OOP.http://www.autoitscript.com/forum/index.ph...ultidimensional Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 31, 2008 Share Posted January 31, 2008 You have to use Execute to account for a large number of dimensions, due to the lack of OOP. http://www.autoitscript.com/forum/index.ph...ultidimensional Wow, that's an interesting idea. It leads to an interesting feature, too. There's an error in that code: ;Loop through all elements within the current dimension For $X = 0 to Ubound($smdArray, $smdDepth) ; ... Next Hmm... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
weaponx Posted January 31, 2008 Share Posted January 31, 2008 It works though, I see no errors. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 31, 2008 Share Posted January 31, 2008 (edited) It works though, I see no errors.Well, that line quoted should have been: For $X = 0 to Ubound($smdArray, $smdDepth) - 1It's wrong, but the problem is masked by the Execute() preventing the expected error, so the function works. If Execute() ever gets changed to allow the same array reference errors you would normally get making it directly, then your function will fail also. P.S. That doesn't change the fact that you wrote a very cool function with a very cool use of Execute() in it... Edited January 31, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
weaponx Posted January 31, 2008 Share Posted January 31, 2008 Well, that line quoted should have been: For $X = 0 to Ubound($smdArray, $smdDepth) - 1It's wrong, but the problem is masked by the Execute() preventing the expected error, so the function works. If Execute() ever gets changed to allow the same array reference errors you would normally get making it directly, then your function will fail also. P.S. That doesn't change the fact that you wrote a very cool function with a very cool use of Execute() in it...I would fix it if I could ever find a use for its output. Unfortunately, not having OOP syntax for arrays forces the usage of Execute(). Nested arrays are an alternative but you still have to work with a limited amount of dimensions to avoid Execute(). The more I think about it, I feel its a waste of time to accomodate an infinite number of dimensions. Maybe its better to use an array of scripting dictionary objects? 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