Log In    |    Knowledge Base    |    4D Home
Tech Tip: Checking variable names within a plug-in
Published On: May 16, 2002

Product: 4D Plug-in SDK 6.8

When displaying a dialog from within a plug-in, remember to check the name of any variables you are accessing very carefully. When naming the variables on the dialog that you wish to use in a Plug-in, make sure you do not add any extra spaces or other non-printable characters. This may cause your code to not execute correctly when accessing the variable from within the plug-in.

Within the plug-in code you would call the PA_ModalDialog to return the last variable chosen in your dialog.

okOrCancel = PA_ModalDialog( dialog, lastVarName );

Typically, after this call we run the "strcmp" C command or "string compare" to see if the variable chosen matches an item we need to act on. In the example below, notice that we are looking for a variable named "Log-In". If we click on this variable/button our plug-in code will execute predetermined code.

if ( 0 == strcmp (lastVarName, "Log-In"))

If you have extra characters hidden when this code is run, the "Log-In" variable will not be found.