Modify

Opened 15 years ago

Closed 15 years ago

#812 closed Feature Request (Rejected)

Addtion of structure like in C

Reported by: winux38@… 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 Changed 15 years ago by Jpm

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
;)

comment:2 Changed 15 years ago by Valik

  • Resolution set to Rejected
  • Status changed from new to 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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.