Announcement

Collapse
No announcement yet.

UDTs, UNIONS, C-code xlation...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • UDTs, UNIONS, C-code xlation...

    Hello,

    I know a UNION within a UDT doesn't seem to be legit in PB, but I
    wrote it below (after the C-code) anyway. That said, how does one
    properly combine UDTs and UNIONs to translate the C-code correctly?

    -CMR


    typedef struct
    {
    union
    {
    long lExpMSec;
    long lClearExpMSec;
    long lRedExpMSec;
    };
    long lGreenExpMSec;
    long lBlueExpMSec;
    short nGain;
    } SPOT_EXPOSURE_STRUCT;


    Code:
    TYPE SPOT_EXPOSURE_STRUCT
       UNION
          lExpMSec AS LONG
          lClearExpMSec AS LONG  
          lRedExpMSec AS LONG    
       UNION END
       lGreenExpMSec AS LONG
       lBlueExpMSec AS LONG
       nGain AS INT
    END TYPE
    ------------------


    [This message has been edited by C.M. Rouleau (edited May 11, 2006).]

  • #2
    Code:
    UNION SPOT_EXPOSURE_UNION
       lExpMSec AS LONG
       lClearExpMSec AS LONG  
       lRedExpMSec AS LONG    
    END UNION
    
    TYPE SPOT_EXPOSURE_STRUCT
       SPOT_EXPOSURE_UNION
       lGreenExpMSec AS LONG
       lBlueExpMSec AS LONG
       nGain AS INTEGER
    END TYPE
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      Thanks, José!

      ------------------

      Comment

      Working...
      X