in the Wiki the Len function is described for strings only but QBasic uses the Len function also to get the size in bytes of data types including udts
but QB64pe also gives the size in bytes of an array, but this seems to be a feature and it behaves strangely
the following works and prints 50, 100 and 200
I think that getting the SizeOf an array would be nice to have and it almost works, perhaps the developers could fix it so that the last statement would be evaluated correctly
but QB64pe also gives the size in bytes of an array, but this seems to be a feature and it behaves strangely
the following works and prints 50, 100 and 200
Code: (Select All)
Dim As Integer i(4, 4)
Dim As Long l(4, 4)
Dim As _Integer64 ll(4, 4)
Print Len(i())
Print Len(l())
Print Len(ll())
but if you add the followingCode: (Select All)
Print Len(l()) / Len(i())
it prints 100 instead of 2, the division never takes placeI think that getting the SizeOf an array would be nice to have and it almost works, perhaps the developers could fix it so that the last statement would be evaluated correctly