BTW, the TYPES were just a demo of the problem as the original source
is copyrighted, so that's why the ASCIIZs weren't properly declared.
Gee, can't put any anything past you guys!

Many thanks to Eric & Kev!
------------------
Mark Newman
$Compile Exe Type MYTYPEA A As Long End Type Type MYTYPEB B As Long End Type Type MYTYPEC C As Long End Type Union MYUNION A As MYTYPEA B As MYTYPEB C As MYTYPEC End Union Function PbMain() Local tUnion As MYUNION tUnion.a.a = 100 MsgBox Str$(tUnion.a.a) ' Returns 100 MsgBox Str$(tUnion.b.b) ' Returns 100 MsgBox Str$(tUnion.c.c) ' Returns 100 End Function
TYPE DEGREES lDegrees AS LONG sDescription AS ASCIIZ * 10 '? lExtraStuff AS LONG END TYPE TYPE RADIANS lRads AS LONG sDescription AS ASCIIZ * 10 '? lExtraStuff AS LONG lMoreStuff AS LONG END TYPE TYPE GRADS lGrads AS LONG sDescription AS ASCIIZ * 10 '? lExtraStuff AS LONG lOtherStuff AS SINGLE END TYPE UNION ANGLES MyDegrees AS DEGREES MyRadians AS RADIANS MuGrads AS GRADS END UNION DIM Something AS ANGLES Something.MyDegrees.lDegrees = 90
UNION Angles TYPE DEGREES lDegrees AS LONG sDescription AS ASCIIZ lExtraStuff AS LONG END TYPE TYPE RADIANS lRads AS LONG sDescription AS ASCIIZ lExtraStuff AS LONG lMoreStuff AS LONG END TYPE TYPE GRADS lGrads AS LONG sDescription AS ASCIIZ lExtraStuff AS LONG lOtherStuff AS SINGLE END TYPE END UNION
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: