[Gambas-bugtracker] Bug #2249: Make Array of Structs work correctly

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sat Jun 12 00:27:13 CEST 2021


http://gambaswiki.org/bugtracker/edit?object=BUG.2249&from=L21haW4-

Comment #4 by John ANDERSON:

OK, is there a way that we can get -Gambas- to tell us what it thinks is the total byte size of array?

I know we can calculate ourselves - For Array of Structs with N Structs, the total size = SizeOf(Struct) * N.  I was just wondering if there was a way to have a built-in method that would give us that result a little cleaner.  If we know SizeOf works perfect on all structs.

It looks like Object.SizeOf(MyStruct) seems to work OK, I can even see padding going on if we have odd number of byte fields stored, etc.  Maybe I was just lucky.  That's why I was thinking Object.SizeOf(MyArrayStruct) would return the correct size of the entire array of structs.

It would be neat if Gambas had a built in special type of Struct[]...just like you have for Integer[], Cariant[], etc.  If possible.




More information about the Bugtracker mailing list