PA_Dial4DGetArrayText

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

version 2003


PA_Dial4DGetArrayText (dialog; variable; text; index) long

ParameterTypeDescription
dialogPA_Dial4DDialog reference
variablechar*Name of the variable to access
textchar*Pointer to the text buffer
indexlongIndex of the text in the array
Function resultlongLength of the text buffer filled

Description

The routine PA_Dial4DGetArrayText retrieves a string from an array of texts. Variable must be the name of an array of strings or texts. You can call this function with a null pointer as a text buffer to first read the size of the buffer to allocate.

Example

   long textsize;
   char* textbuffer = 0;

   textsize = PA_Dial4DGetArrayText( dialog, "vTextArray", 0, 1 );
   if  ( textsize )
      textbuffer = malloc( textsize );
   
   if ( textbuffer )
   {
      PA_Dial4DGetArrayText( dialog, "vTextArray", textbuffer, 1 );
      /* --- */
      free( textbuffer );
   }

Because 4D text buffers are limited to 32000 chars, you can also write the following (though it requires more stack space):

   long textsize;
   char textbuffer[ 32000 ];

   textsize = PA_Dial4DGetArrayText( dialog, "vTextArray", textbuffer, 1 );

See Also

PA_Dial4DNewArrayText, PA_Dial4DSetArrayText.


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