version 2003
PA_Dial4DGetArrayText (dialog; variable; text; index) long
Parameter | Type | Description | |
dialog | PA_Dial4D | Dialog reference | |
variable | char* | Name of the variable to access | |
text | char* | Pointer to the text buffer | |
index | long | Index of the text in the array | |
Function result | long | Length 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.