PA_GetTextInArray

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

version 2003


PA_GetTextInArray (array; index; text) long

ParameterTypeDescription
arrayPA_VariableArray to access
indexlongIndex of the element to access
textchar *Pointer to the text
Function resultlongSize of text in bytes

Description

The routine PA_GetTextInArray fills the data pointed to by text with the text data of the index element of the text array array, and returns the size of the text.

First, pass zero in text to get the size of the text, then allocate a buffer with the correct size and again call the routine passing it this buffer. See the example below.

If the array is not a eVK_ArrayText or if index is out of range, the routine returns 0 and leaves text unchanged.

PA_GetTextInArray fills the data with Macintosh characters on Macintosh and ANSI characters under Windows, unless you have previously called the PA_UseMacCharacters or PA_UseAnsiCharacters function.

Example

Get the value of the current element (no error check in this sample).

   char   *buffer;
   long   size;

   size = PA_GetTextInArray( arr, PA_GetArrayCurrent( arr ), 0L );
   buffer = malloc( size );
   size = PA_GetTextInArray( arr, PA_GetArrayCurrent( arr ), buffer );
   /* . . . work with text buffer . . . */
   free( buffer );

See Also

PA_SetTextInArray, PA_UseAnsiCharacters, PA_UseMacCharacters.

Error Handling

None.


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