Jump to content
Sign in to follow this  
BruceCopperField

Passing Record DataType

Recommended Posts

BruceCopperField

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?

Share this post


Link to post
Share on other sites
rudi

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!

Share this post


Link to post
Share on other sites
BruceCopperField

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×