Author Topic: how to do a Union in O2  (Read 126 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris Chancellor

  • Sr. Member
  • ****
  • Posts: 306
how to do a Union in O2
« on: January 15, 2019, 03:01:54 AM »
Hello Charles

in Pb they have a UNION statement to create a data structure for example

Code: [Select]
UNION ipAddress
   address AS LONG
   octet(1 TO 4) AS BYTE
END UNION


DIM IpAdn AS ipAddress


how do we rewrite this structure in O2 ?

Thanxx in advanced

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
    • Charles Pegge
Re: how to do a Union in O2
« Reply #1 on: January 15, 2019, 06:59:16 AM »
Hi Chris,

unions are much the same in o2:

Code: [Select]
UNION ipAddress
   address AS LONG
   octet(4) AS BYTE
END UNION

DIM IpAdn AS ipAddress
« Last Edit: January 15, 2019, 07:00:51 AM by Charles Pegge »

Offline Chris Chancellor

  • Sr. Member
  • ****
  • Posts: 306
Re: how to do a Union in O2
« Reply #2 on: January 15, 2019, 04:22:25 PM »
Thanxx a lot Charles