Hi Erel,
We use a lot of structures in our applications, as we communicate with remote Bluetooth and WiFi devices; marshalling structures etc.
Would it be possible to provide a method that allows us to retrieve the size of a Typed variable (in bytes). This would be especially useful in the case of "Typed" variables that which contain dozens of fields and other Typed variables. We don't want to hard-code the size if possible as it makes the code more difficult to mainain.
As an example:
Someone may have asked this before, but I tried searcfing the forums for sizeof, .length and .size related questions and drew a blank.
Thanks in advance,
Steve
We use a lot of structures in our applications, as we communicate with remote Bluetooth and WiFi devices; marshalling structures etc.
Would it be possible to provide a method that allows us to retrieve the size of a Typed variable (in bytes). This would be especially useful in the case of "Typed" variables that which contain dozens of fields and other Typed variables. We don't want to hard-code the size if possible as it makes the code more difficult to mainain.
As an example:
B4X:
Type RSP_GET_STATS_T (Command, Dummy As Byte, Result As Short, LastError As Short, Bearing, AddrLie, AddrPress, CorrTwist As Float, _
AddrMatrix As S16Matrix3X3T, SwingArc As Float, ImpType As Short, ImpFaceAngle, ImpPathAngle, ImpShaftAngle, ImpLieAngle, AttackAngle As Float, _
SOSRec, TOSRec, ImpRec As Short, MaxMph, ImpMph As Float, BackMs, DownMs, Checksum As Short)
Dim Stats As RSP_GET_STATS_T;
Dim length as int : Length = Stats.Size
Someone may have asked this before, but I tried searcfing the forums for sizeof, .length and .size related questions and drew a blank.
Thanks in advance,
Steve