KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Getting garbage displayed when using an Alert, Confirm, or Request dialog with t
PRODUCT: 4D | VERSION: 6.7.1 | PLATFORM: Mac & Win
Published On: June 15, 2001

If when using the API commands PA_Alert, PA_Confirm, or PA_Request garbage is displayed along with the Alert text you need to quit and initialize the Text/String variables to an empty string before using. If you do not there is a very good chance that the Variables will be filled with random ascii characters from being assigned in memory. By assigning the variable to an empty string you remove the garbage characters. The PA_Alert command example below demonstrates this. Note the variable Display_Text is assigned to an empty string.

void Display_Alert( PA_PluginParameters params )
{
long DisplayText_len;
char DisplayText[256]="";

DisplayText_len = PA_GetTextParameter( params, 1, DisplayText );

PA_Alert(DisplayText);
}

For more information on 4D Plug-in development? Visit:
https://www.4D.com/SDK