I need to prototype a C++ struct in Clarion, but the problem is that the
struct has
a UNION inside, for example...
typedef struct { // smiVALUE portion of VarBind
smiUINT32 syntax; // Insert SYNTAX_<type>
union {
smiINT sNumber; // SYNTAX_INT
smiUINT32 uNumber; // SYNTAX_UINT32
} value; // union
} smiVALUE, *smiLPVALUE;
thanx in advance..
Thiago
---
!!! I assume the following data type equates:
smiINT equate(short)
smiUINT32 equate(ulong)
smiVALUE group,type
value group
sNumber smiINT
uNumber smiUINT32
end
syntax smiUINT32,over(value)
end
---
-Ray.
"Thiago Luiz" <thiag...@icqmail.com> wrote in message
news:3d5d...@news.softvelocity.com...
The question here is that the UNION apparently sets the inner variables
values when the outer variables values changes, automatically.
These guys are trying to achieve kinda same functionality from Clarion. This
prototype will be used on an SNMP automation process.
Any ideas?
TIA
---
!!! I assume the following data type equates:
smiINT equate(short)
smiUINT32 equate(ulong)
smiVALUE group,type
syntax smiUINT32
value group
uNumber smiUINT32
sNumber smiINT,over(uNumber)
end
end
---
-Ray.
"Gustavo Pinsard" <pin...@hotmail.com> wrote in message
news:3d5d...@news.softvelocity.com...
Now let's just hope that sNumber isn't assigned the result of a calculation
involving uNumber.
Thanks a lot.
My guess for switching the declaration order of uNumber and sNumber is
because Clarion does will not overlay a variable with more memory storage (4
byte) over one with less (2 byte). By switching the order, you are
overlaying sNumber (2-byte) over uNumber which is 4-byte.
Edward
"Ray Goudie" <rgo...@yahoo.com> wrote in message
news:3d5d29b8$1...@news.softvelocity.com...
-Ray.
"Edward Loh" <Edwa...@email.msn.com> wrote in message
news:3d5ec69e$1...@news.softvelocity.com...