The allocation size routines provide information about the amount of storage allocated for variables and components of various types. The parameters may be in the form of variable or type identifiers. Each routine returns an integer value that represents the allocation size of the given parameter.
1 – BITNEXT
The BITNEXT function returns an integer value that indicates the number of bits that would be allocated for one component of the specified type in a packed array or if the specified variable appeared as a cell in a packed array. Syntax: BITNEXT( x ) The parameter 'x' can be a variable or any type identifier.
2 – BITSIZE
The BITSIZE function returns an integer value that indicates the number of bits that would be allocated for one field of the specified type in a packed record or if the specified variable appeared as a field in a packed record. Syntax: BITSIZE( x ) The parameter 'x' can be a variable or any type identifier.
3 – BIT_OFFSET
The BIT_OFFSET function returns an integer value that represents the bit position of a field in a record. Syntax: BIT_OFFSET( t,f ) The parameter 't' can be of any record type or variable, and the parameter 'f' can be any field contained in that record.
4 – BYTE_OFFSET
The BYTE_OFFSET function returns an integer value that represents the byte position of a field in a record. Syntax: BYTE_OFFSET( t,f ) The parameter 't' can be of any record type or variable, and the parameter 'f' can be any field contained in that record.
5 – NEXT
The NEXT function returns an integer value that indicates the number of bytes that would be allocated for one component of the specified type in an unpacked array or if the specified variable appeared as the cell in an unpacked array. Syntax: NEXT( x ) The parameter 'x' can be a type identifier or variable. Cells in an unpacked array are affected by alignment attributes and, by default, are byte or naturally aligned. Therefore, the size returned includes the actual size of the type or variable, in addition to trailing space required to ensure proper alignment.
6 – SIZE
The SIZE function returns an integer value that indicates the possible or actual number of bytes that are allocated for a specified data type or variable. Syntax: SIZE( x[[,t1,...,tn]] ) The parameter 'x' can be a type identifier or a variable. If 'x' is a type identifier, then SIZE returns an integer value which indicates the number of bytes that would be allocated for a variable or record field of type 'x'. If 'x' is a variable, then SIZE returns an integer value that indicates the number of bytes that are allocated for that variable. In the case where the parameter 'x' is a variant record variable or variant type identifier, SIZE returns an integer value that indicates the number of bytes that are allocated (for a variant record variable) or would be allocated (for a variant type identifier) for both the fixed portion of the record and the largest variant. In addition you can supply additional parameters t1 through tn that correspond to the case labels of the record. The SIZE routine returns an integer value that indicates the number of bytes that would be allocated by the NEW procedure for a dynamic variable of the specified variant.