Please enable JavaScript to view this site.

A-Shell Reference

Added April 2013

.OFFSIZ$(struct.member)

This is a variation of the .OFFSET() function which returns the combination of the specified structure member's offset and size, as a string formatted as "offset~size". While the combination of the two values in a string may seem unusual, since the offset and size are often used together, the combined format eliminates the need to specify the struct.member name twice, which invites discrepancy, and lends itself to use in runtime functions that may parse out the two values and combine them with other information.

Here are some examples using the structure given in the description of .OFFSET() in 6.1.1350.0 below:

? "Offset~size of FLD1 in ST_1: "; .OFFSIZ$(ST_1.FLD1)   ! "1~10"

? "Offset~size of FLD2 in VAR : "; .OFFSIZ$(VAR.FLD2)    ! "11~13"

? "Offset~size of FLD3 in VX(): "; .OFFSIZ$(VX().FLD3()) ! "24~6"

.OFFSIZ$() is particularly handy in building XTREE coldefs, e.g.:

coldef$ += .OFFSIZ$(ST_1.FLD1) + "~Field~S~~"   ! 1~10~Field 1~S~~

or, using a hypothetical function to build the entire definition for an XTREE column:

coldef$ += Fn'Coldef$(.OFFSIZ$(ST_1.FLD1), title$, cformat$, option$)

History

2013 April, A-Shell 6.1.1350:  Function added to A-Shell