Powerbasic Museum 2020-B

IT-Consultant: Charles Pegge => OxygenBasic => Topic started by: Chris Chancellor on January 15, 2019, 03:01:54 AM

Title: how to do a Union in O2
Post by: Chris Chancellor on January 15, 2019, 03:01:54 AM
Hello Charles

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


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
Title: Re: how to do a Union in O2
Post by: Charles Pegge on January 15, 2019, 06:59:16 AM
Hi Chris,

unions are much the same in o2:


UNION ipAddress
   address AS LONG
   octet(4) AS BYTE
END UNION

DIM IpAdn AS ipAddress

Title: Re: how to do a Union in O2
Post by: Chris Chancellor on January 15, 2019, 04:22:25 PM
Thanxx a lot Charles