version 2003
PA_GetPointerKind (pointer) PA_PointerKind
Parameter | Type | Description | |
pointer | PA_Pointer | The pointer to analyze | |
Function result | PA_PointerKind | Type of pointer |
Description
The routine PA_GetPointerKind returns the type of pointer.
NOTE
4th Dimension pointers are not standard C pointers. They are structures that tell 4D to what kind of data they point: a table, a field, or a variable (process or interprocess).
Since a pointer does not have the same definition and use in interpreted and compiled mode, the developer should use the accessors of this API.
PA_GetPointerKind returns a value of type PA_PointerKind, defined in PublicTypes.h as:
typedef enum { ePK_InvalidPointer = -1, ePK_PointerToVariable = 0, ePK_PointerToTable, ePK_PointerToField } PA_PointerKind;
Example
Check the kind of a pointer before using the object pointed to by it:
short DoWithTablePointer (PA_Pointer thePtr) { /* . . . code . . . */ if ( PA_GetPointerKind( thePtr ) != ePK_PointerToTable ) return kMY_ERROR_BAD_4DPOINTER; /* . . . code . . . */ }
See Also
PA_GetPointerParameter, PA_GetPointerTableField, PA_GetPointerValue, PA_GetPointerVariable.
Error Handling
PA_GetLastError() keeps the last error that occurred before calling the routine.