FutureBasic Logo

<<    Index    >> FutureBasic

offsetof   function

byteOffset = offsetof(fieldName in {recordType | recVar})

Use this function to find where a particular field begins within a record. offsetof returns the field's offset as a number of bytes past the beginning of the record.
The recordType is the name of a "record" type as defined in a begin record statement; recVar is a variable declared as a "record" type; fieldName is the name of a field within that "record" type.
The value passed as fieldName is seen by the compiler as a constant. You do not use type designator suffixes like $,&,#, etc.

See also
sizeof; typeof; begin record; Appendix C - Data Types and Data Representation