Recently we noticed a new idea on the FileMaker Community, a wish to extend the custom functions dialog with some useful capabilities to execute a custom function or check the syntax. And that's what wish was my puzzle for the weekend to solve. I remembered we had something like this in FileMaker as database: Formatting and error checking expressions in FileMaker, where you can enter a formula, format syntax and check for errors. Let's put that from a script to C++ and do it within the plugin:
As you see we got two new buttons for the custom script editor dialog in FileMaker Pro. When you click Check Syntax, we take your expression and build a test expression around it. We wrap it in a Let statement to define the parameters as local variable and then we let FileMaker's Evaluate() function check for errors without executing it.
The second button executes the script. If you have comment lines starting with /// followed by the parameter name and an equal sign, we will take those to initialize the parameters. The result is shown in the dialog left to the buttons. If text is longer, you can scroll the area via mouse wheel. Please note that this will show result as text and looses formatting.
Please note that the variable assignments can use other custom functions. But if any of the functions call itself, you will call the version before your modifications. If Claris someday implements this into FileMaker Pro, they may do some trick to temporary replace the function with your edits to make sure recursion runs the new version. Please avoid endless loops or endless recursion as you may need to wait a long time.
Please try the new feature later this week with 11.1pr3. Let us know what you think. If you like to try it earlier, please contact us.
Update: Based on user feedback we will use /// to mark parameter assignments. This should avoid confusion with existing comments.