' UNION/END UNION and ENUM/END ENUM definitions
#COMPILE EXE
#DIM ALL

TYPE MyVariant
    b AS LONG
    w AS LONG
    l AS LONG
END TYPE

CONST RED = 1
CONST GREEN = 2
CONST BLUE = 3

FUNCTION PBMAIN() AS LONG
    LOCAL v AS MyVariant
    LOCAL c AS LONG

    v.l = &H12345678
    PRINT "UNION as LONG:" + STR$(v.l)

    c = RED
    PRINT "RED:" + STR$(c)
    PRINT "GREEN:" + STR$(GREEN)
    PRINT "BLUE:" + STR$(BLUE)

    PRINT "Done."
    FUNCTION = 0
END FUNCTION
