Page 1 of 1

[Implemented] Sizeof

Posted: Tue Jun 11, 2002 7:00 pm
by BackupUser
Restored from previous forum. Originally posted by tinman.

Hi,

Would it be possible to have sizeof work more like the Blitz Basic 2 Sizeof? You know, you could do:

Code: Select all

Structure foo
  a.w : b.w
EndStructure
; ...
PrintN(Str(Sizeof(foo\b)))
And it would print 2, as it calculates the offset into the structure for the variable. Also, having it evaluated at compile time and usable in your code would be excellent:

Code: Select all

Structure foo
  a.w : b.w
EndStructure
; ...
DataSection
Data.l Sizeof(foo)
EndDataSection

--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.20)