Modify

Opened 16 years ago

Closed 16 years ago

#1386 closed Feature Request (Rejected)

Union support

Reported by: monoceres Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: union dll Cc:

Description

Working with unions in dllstructs is extremely annoying and tiresome to work with. If autoit could provide some easier way it would be superb.

Attachments (0)

Change History (4)

comment:1 by TicketCleanup, 16 years ago

Version: 3.3.2.0

Automatic ticket cleanup.

comment:2 by Valik, 16 years ago

Did you have a specific syntax in mind?

comment:3 by monoceres, 16 years ago

Syntax is tricky. DllUnionCreate() is the obvious solution, but makes it rather useless since most unions in the wild are found in structs with other members as well.

Maybe something like this?
DllStructCreate("int;{short;float;double;}")

Where everything inside the {} is treated as a union. If it could be nested then it would be perfect. It would solve any kind of data format involving unions I've seen.

comment:4 by Valik, 16 years ago

Resolution: Rejected
Status: newclosed

That syntax won't work. DllStructGetData() wouldn't know what to return. Thinking about it, why is this an issue? Don't you know at compile time which particular piece of data you want? For example, in your example, assume you want to use the "short" data. You calculate the size of the member to be 64-bits (the size of the largest union member which is double). Thus you would use int64. I can't imagine it being very common that you need to access more than one type of union members.

I think I'm going to close this as rejected because:

  1. I don't see many unions.
  2. The syntax is going to be difficult to get usable in order for AutoIt to do the right thing.
  3. My experience with unions has been that I needed one of the data types so in AutoIt I would just use the best size type for that data-type.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.