Opened 17 years ago
Closed 17 years ago
#812 closed Feature Request (Rejected)
Addtion of structure like in C
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
I read that you are not ready to add OOP concept in autoit and I agree with this but it is painful to define structured data array.
I am using a lot a structured array and the only way to get them is to define an enum with all the fields offset in the array and to define an array. This needs definition of a lot of constants which needs to be exported everywhere.
It would be better to define a struct and access directly members.
declaration:
Defstruct mystruct_t [ _
field1, _
field2, _
field3 ]
instaciation:
Struct mystruct_t mystruct = [initfield1, initfield2 , initfield3]
access:
mystruct.field1 = data
I agree it is very C like but so easy to use.
Attachments (0)
Change History (2)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | new → closed |
We are not going to add this and your request epitomizes why we won't. Structures are for DllCall() only. They are not a mechanism for constructing user-defined types. What you describe is the very reason we keep this feature out of the language so thank you for proving my point why we shouldn't add it.

At least the access was implemented long time ago but was rejected due to possible confusion with Obj/COM supported type.
Perhaps Valik or Jon can comment on this subject.
Not sure ther is not a C struct to dllstruct conversion program/script available somewhere. At least it can be helpfull for those writing UDFs
;)