Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 1380 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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:

CustomFunctions.jpg

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.

CustomFunctions2.jpg

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 with 11.1pr3 or later. Let us know what you think. If you like to try it earlier, please contact us.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.