Report An Issue is intended for Reporting Possible Software bugs. Questions on how to work with FileMaker Pro should be posted in the FM Pro Forum Section. (See tab at top of this screen.)
Any expression that uses a calculation, set field, set variable, If, just to name a few can use a calculation that includes a call to a custom function.
Example from one of my scripts:
If [ ValidUPC ( MyTable::BarCodeField ) ]
Do code if UPC is valid
Do Code to scan again or manually enter code if UPC is not valid
ValidUPC is one of my custom functions. (It validates a Universal Product Code when I use my iPhone to scan a product bar code.)
Global variables can be referenced in exactly the same scripts steps where you can reference a custom function.
Many of my script trigger controlled scripts check the value of a global field named $$TriggersOff
If [ Not $$TriggersOff ]
Rest of script goes here
That allows me to use other scripts to set $$TriggersOff to true when I want to disable the trigger controlled scripts.
You are setting some triggers
My problem is a global variable is set to either 1 2 3 or 4
Now i want to in a script to do different actions based on the value of this global variable.
I'm in transision from Access and find the script making very limited because one has to klik on a funktion
The funktion get value isn't a option and that stalls me :-)
Thank you for very quick answer
Thank you for your posts.
Here are the steps to evaluate for the different values of the variable:
If [ $variable = "1" ]
<perform some actions>
Else If [ $variable = "2" ]
<perform another set of actions>
Else If [ $variable = "3" ]
<perform a third set of actions>
Else If [ $variable = "4" ]
<perform a fourth set of actions>
<optional set of actions, or just omit "Else">
Let me know if you need additional clarification.
I'm persisten :-)
What if i don't know the value of the variable ?
I want to "get" the value and copy use it elswhere
fx copy the value into a field/record
Set Field [ <field name> ; <variable name> ]