Compatibility: 6.7.x and 6.8.x
When a pointer to a field is passed as a parameter, it is frequently desirable, or necessary, to have a pointer to the table to which the field belongs.
The following commonly used code reduces the need to pass a table pointer as a separate parameter.
Though the code in this routine is very short, it has been implemented in a separate routine named Shell_PointerToTableForField in order to be reused. Reuse, even of such small amounts of code, prevents errors (such as typos), and eliminates the need for retesting the code each time it is written.
Here is the 4D ORDER BY command using Shell_PointerToTableForField to return a pointer to a table:
ORDER BY(Shell_PointerToTableForField ($pFieldToOrderBy)->;$ pFieldToOrderBy ->;>)
Here is the code of Shell_PointerToTableForField:
`$pTable:=Shell_PointerToTableForField (Field pointer)
`When passed a field pointer, returns a pointer to the fieldˇs table.
`$1 Field pointer
`$0 Table pointer for field pointer passed in $1