Please enable JavaScript to view this site.

A-Shell Reference

Added February 2022

.DYNOFFSET(ds.member)

.DYNOFFSET(ds.@member$)

.DYNOFFSET() returns the offset to the specified DYNSTRUCT member from the base of the structure, starting at 1. Equivalent to .OFFSET() except applies only to DYNSTRUCTs, and is evaluated at run time instead of compile time.

In both variations, ds should be either an mapped instance of a structure, or the structure definition name from the defstruct. The difference between the two variations is that in the first case, member must be an actual reference to a member of the specified structure, whereas in the second case member$ should be a string variable whose value matches a member of the structure. See Dynamic Structure Reference / Usage for more details.

Note that the offset to a DYNSTRUCT member can also be retrieved in the pos member of the ST_FLDDEF structure returned by MX_DYNSTRUCT (DYNOP_INFO), except that it starts at zero whereas .DYNOFFSET() starts at 1.

See Also

Introduction to Dynamic Structures

History

2022 February, A-Shell 6.5.1711:  Function added to A-Shell