Does anyone know if unions have a size restriction?
Here is the curiosity that I am having:
Union DataBuf
byteBuf(3000000) as BYTE
quadBuf(375000) as QUAD
End Union
'-----------------------------------------
Function AccessUnion(Buf as DataBuf) as Long
'just try to manipulate data in Buf
Dim l&
For l& = 0 to 7
Buf.byteBuf(l&) = 1
Next l&
End Function
'-----------------------------------------
Function PbMain() as Long
Dim Buf as DataBuf, l&
l& = AccessUnion(Buf) 'get stack overflow
End Function
I just typed the above out (look for typos when compiling)
because I am not sitting at my computer. The curiosity is
that it does not generate a Run Time Error if the values
for the union are less than one meg or so, ie:
Union DataBuf
byteBuf(900000) as BYTE
quadBuf(112500) as QUAD
End Union
Thanks for any help.
Cheers,
Michael
------------------
Here is the curiosity that I am having:
Union DataBuf
byteBuf(3000000) as BYTE
quadBuf(375000) as QUAD
End Union
'-----------------------------------------
Function AccessUnion(Buf as DataBuf) as Long
'just try to manipulate data in Buf
Dim l&
For l& = 0 to 7
Buf.byteBuf(l&) = 1
Next l&
End Function
'-----------------------------------------
Function PbMain() as Long
Dim Buf as DataBuf, l&
l& = AccessUnion(Buf) 'get stack overflow
End Function
I just typed the above out (look for typos when compiling)
because I am not sitting at my computer. The curiosity is
that it does not generate a Run Time Error if the values
for the union are less than one meg or so, ie:
Union DataBuf
byteBuf(900000) as BYTE
quadBuf(112500) as QUAD
End Union
Thanks for any help.
Cheers,
Michael
------------------
Comment