|
![]() |
![]() |
version 2003
PA_GetPointerVariable (pointer; index) → PA_Variable
Parameter | Type | Description | |
pointer | PA_Pointer | → | The 4D pointer |
index | long * | ← | Index if the pointer points to an array element |
Function result | PA_Variable | ← | The variable pointed to by the pointer |
Description
The routine
PA_GetPointerVariable
returns the variable pointed to by
pointer
. If
pointer
is a pointer to an array element, it sets
*index
to the number of this element.
NOTE
4th Dimension pointers are not standard C pointers. They are structures that tell 4D what kind of data they reference: 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.
You can use
PA_GetPointerKind
to determine what kind of pointer
the4Dptr
is.
Example
Get a longint array pointed to by
pointer
:
PA_Variable array;
long ignore;
/* . . . */
if ( PA_GetPointerKind( a4Dptr ) == ePK_PointerToVariable )
{
array = PA_GetPointerVariable( a4Dptr, &ignore );
if ( PA_GetVariableKind( array ) == eVK_ArrayLongint )
{
/* . . . code using array . . . */
}
}
See Also
PA_GetPointerKind , PA_GetPointerParameter , PA_GetPointerTableField , PA_GetPointerValue .
Error Handling
Use
PA_GetLastError
to see if an error occurred (Other pointer accessors do not touch
PA_GetLastError
).