Structure Unions

General discussion forum for Ams Plugin Maker
Post Reply
User avatar
Shrek
Registered User
Posts: 49
Joined: Mon Aug 12, 2013 10:10 pm

Structure Unions

Post by Shrek »

Code: Select all

STRUCTUREA = __Memory.CreateStruct(
 _int, "A",
 -- Union
 _int, "B",
 _int, "C",
 -- Union end
 _int, "D",
 _int, "E");
-- 16 bytes

STRUCTUREB = __Memory.CreateStruct(
 _int, "A",
 _int, "B",
 _int, "C",
 _int, "D",
 _int, "E");
-- 20 bytes
Sometimes the size of the structure is important and more ofter than not when it is important a union is involved, STRUCTUREA is 16 bytes and STRUCTUREB is 20 bytes and the difference is the union so how do we use unions in APM?
Post Reply