Why element size is not 2?
#5
Look what happens when try to REDIM s(0) as a normal variable:
Code: (Select All)
Type snd1
    l As Integer
    r As Integer
End Type

Type snd2
    l As _Unsigned _Byte
    r As _Unsigned _Byte
End Type


ReDim s(0) As snd2 '1
Print Len(s(0).l) 'expected is 1

' !!!! is there a way to clear a varaible from memory right here???
redim as long s(0)  ' <<<<<<<<<<<< red lined !!!
ReDim s(0) As snd1 '2  ' so this should not be legal either
'_Delay .1 'wait to clear first instance of s(0)
Print Len(s(0).l) 'expected is 2

s(0).l = 55
Print s(0).l ' expect 55  OK
Print Len(s(0).l) 'expect 2 what?
b = b + ...
Reply


Messages In This Thread
Why element size is not 2? - by Petr - 04-23-2023, 11:57 AM
RE: Why element size is not 2? - by Petr - 04-23-2023, 01:26 PM
RE: Why element size is not 2? - by SMcNeill - 04-23-2023, 01:45 PM
RE: Why element size is not 2? - by bplus - 04-23-2023, 02:22 PM
RE: Why element size is not 2? - by bplus - 04-23-2023, 02:30 PM
RE: Why element size is not 2? - by Petr - 04-23-2023, 03:31 PM
RE: Why element size is not 2? - by bplus - 04-23-2023, 03:49 PM
RE: Why element size is not 2? - by mnrvovrfc - 04-23-2023, 04:09 PM
RE: Why element size is not 2? - by bplus - 04-23-2023, 05:56 PM
RE: Why element size is not 2? - by SMcNeill - 04-23-2023, 06:15 PM



Users browsing this thread: 7 Guest(s)