BruceCopperField Posted February 21, 2008 Share Posted February 21, 2008 I need to pass a record of logically related parameters to a function and they are of different types. I think using Array as if it is a struct type is the only choice. But my record actually contains another sub-record. Should I use nested Array to achieve this? The manual says:This has not been strictly forbidden in AutoIt. However, it is NOT ADVISABLE to mix different datatypes in an Array. Especially the use of an Array inside another Array will severely affect the execution speed of your script.What should I use? Link to comment Share on other sites More sharing options...
rudi Posted February 21, 2008 Share Posted February 21, 2008 Hi. I need to pass a record of logically related parameters to a function and they are of different types. I think using Array as if it is a struct type is the only choice. But my record actually contains another sub-record. Should I use nested Array to achieve this? The manual says: Try not to pass these arrays, Func MyFunc(ByRef $Array1, ByRev $Array2, ...) EndFuncoÝ÷ ÚȦ¦°¢¹0Ømé¢*.û§rب«¢+ÙÕ¹5åÕ¹ ¤(ÀÌØíÉÉäÅlÉtôÀÌØíÉÉäÉlÑt¨ÐÈ)¹Õ¹ Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
BruceCopperField Posted February 22, 2008 Author Share Posted February 22, 2008 But the point is I don't want to over-rely on global variables. My script is getting huge and complicated. If we still remember our first programming course, global variable is evil. It creates large coupling to the external environment. What I want is to keep my functions depend on their own parameter lists only. But my parameters are getting large in number and I want to group them into logical records instead of a plain huge list. 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