FileMaker Include Script script step

FileMaker

Image via Wikipedia

I would really love to have a FileMaker Include Script Step. Ideally, it would function just like php's Include function. "Why?", You might ask. "We already have a perfectly good Perform Script Script step. That lets me break up my code into smaller chunks".

Yes that is true, but when you call Perform Script, you get a brand new script, with its own variable scope. I would love to be able to have the option to "include" a script in the current one. That included script would run in the exact same Variable scope as its parent.

It would solve this common problem.

A script declares several variables at the top of the script, then it calls a subscript.  If that subscript needs any of those variables you have to make sure to pass them explicitly.  That is easy enough if there is one or two, but if there is a lot of them it gets tedious.

With PHP this is no problem.  You just use "include" and your subscript runs as though it was part of the current script. It has access to all of the variables that were declared in the first script.

What do you think?

Cast a vote, yes or no

Reblog this post [with Zemanta]