| Explore Other Plug-ins |
|
2empowerFM Super Variables
Super Variables allows you to store data in named variables in FileMaker 7 and later. Super Variables are similar to variables in FileMaker 8 and later, but any number of Super Variables can be set within any calculation, not just one variable per Set Variable script step.
Super Variables can also have script, window, database, or global scope. That means a variable called "MyVar" in one window can have a different value than "MyVar" in another window. Use such variables to track which tabs to draw in different windows, or anything specific to a window. Database scope variables keep you from accidentally overwriting a global variable in someone else's database that you don't control.
Global Super Variables can do things that FileMaker global variables can't. Say a Notes table is related to a Contacts table by PersonID or OrgID stored in both tables. You show the Notes related to each Contact in a portal, but you'd like to display whether the Note is matching the Contact person, Contact org, or both. You can't check if Notes::PersonID = Contact::PersonID because each Note may match many Contacts. Instead, put a field on your layout whose calculation sets a global Super Variable to the current PersonID, then check if Notes::PersonID equals the global super variable.
Super Variables also helps you with script parameters. FileMaker scripts take only a single parameter. To pass multiple values in that single parameter, you might pass a string like "PersonID = 1; OrgID = 2". In the script, you can get the value of "PersonID" using Evaluate("Let([" & Get(ScriptParameter) & "]; PersonID)")
The expression is long and hard to write, and it can lead to bugs. If your table has a PersonID field, and you ever forget to pass PersonID in the script parameter, you'll get the value of PersonID from your table instead. Use Super Variables epParam("PersonID") function to avoid these problems.