PA_GetPointerVariable

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_GetPointerVariable (pointer; index) PA_Variable

ParameterTypeDescription
pointerPA_PointerThe 4D pointer
indexlong *Index if the pointer points to an array element
Function resultPA_VariableThe 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).


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next