Search Project Mgmt
Search FileMaker Blogs
FileMaker Blog
Tuesday
Jul172007

FILEMAKER: The Else If Script Step

From Dwayne Wright - www.dwaynewright.com

At the time I’m writing this, I’m not sure when this script step appeared. I believe it was FileMaker 8 but it could have been as early as FileMaker 7. Basically it is a combination of the If and Else script steps. I wrote the following on purpose because it the actions are actually flipped (as the name implies).

The ElseIf needs to follow an IF script step (or another Else If) and it allows you to embed a calculation. If that calculation is a TRUE result (1=1 for example), then the script will perform all the script steps between that ELSE IF to a branch ending script step (such as another ELSE IF, END IF, Exit or Halt).

As I alluded to earlier, you can have many ELSE IF script steps in a scripts. This allows you to write a script that has an almost endless number of different branching actions.
=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2007 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Monday
Jul162007

FILEMAKER: Script Troubles

From Dwayne Wright - www.dwaynewright.com

Just because FileMaker makes the creation of scripts so easy, doesn’t mean you won’t run into troubles. In fact in some cases because FileMaker makes scripting so easy, you can run into troubles. We chatted earlier about planning your script and scripting your plan. This is the exception in the design of most FileMaker solutions. The vast majority of the time, the scripting thought process is done at the very same instant as the scripting design process.

That can lead to problems ... hmmm ... perhaps 5% of the time and the problems are usually in the most complex of scripts. In this series of discussions, I want to cover some common gotchas that you may encounter and then cover the analysis and troubleshooting process of FileMaker scripts.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2007 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Monday
Jul162007

FILEMAKER: The Else Script Step

From Dwayne Wright - www.dwaynewright.com

The Else script step is the fork in the road when you want to branch from an IF STATEMENT into two or more possible directions. When a script runs and sees the IF step, it checks to see if the IF condition is TRUE or FALSE. If TRUE, then it will run the steps between the IF and the ELSE from top to bottom. If FALSE, ScriptMaker passes over all the steps until the ELSE step. Then begins to run the script steps after the ELSE statement to it's associated End If step.

There is an order that has to be adhered to in regards to the Else script step. It must appear between an If and End If script step. If it does not, FileMaker will bark at you when you try to close that script.

Got To Know Factor - 10

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2007 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Sunday
Jul152007

FILEMAKER: The If Script Step

From Dwayne Wright - www.dwaynewright.com

The IF script step ( in concert with the Else, Else If and End If steps ) allows you to branch a script into multiple directions. When a script runs and sees the IF step, it checks to see if the IF condition is TRUE or FALSE. If TRUE, then it will run the steps between the IF and the ELSE (or ELSE IF) step from top to bottom. If FALSE, ScriptMaker passes over all the steps until it reaches the ELSE (or ELSE IF) step. Then begins to run the script steps after the ELSE statement. The If script step must also include and Else and End If step to branch.

FYI... About the Else If, this was step made it’s appearance in FileMaker 8 and I’ll discuss it in detail in a different discussion.

Here are a few example that the IF branch can be based upon...

a user choice ( like with the show message dialog box )

a value in a field ( like what the user entered on a particular record) an environmental condition ( when used in concert with Status or Design functions ) or just about anything that you can use a FileMaker calculation field to evaluate.

You can place an IF script step within another IF script step ( called nesting ) and this allows you to branch a script in more than two directions.

HOW IT IS USED
The IF Statement is one of the main areas that can separate the beginner
FileMaker script designers from the intermediate or advanced ones. You can build an almost unlimited level of functionality by using this step. Branching can be done based upon a users choices, users data entry, the environment of the computer / database / network and even password access level.

COOL IMPLEMENTATIONS OF IT
One of my favorites is when someone uses a Get function to see how big your computer screen is and then navigates to custom layouts for that size.
You can also use the IF statement to pass over a set of script steps by always having a False result. Below you can see that my blah, blah, blah action is passed over because 1 will never equal two.

IF ( 1 = 2)
blah, blah, blah,
ELSE
END IF

FYI...
IF statements are advanced levels for FileMaker. It's almost always best to do them as separate subscripts unless you are an experienced IF STATEMENT commando.

Got To Know Factor - 10

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2007 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Saturday
Jul142007

FILEMAKER: The Halt Script Step

From Dwayne Wright PMP - Certified FileMaker Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

This step halts ScriptMaker from running completely. This is a way out of a currently running script and any subscripts attached to it. This is the opposite of the Exit script step that only stops the current running script.

HOW IT IS USED
Halt Script is usually used as a logical branch option. If the user chooses this or a set of tested conditions are true then .... get out of here... otherwise, do something else.

I’ve also seen this script step be used as a kill switch when developing a complex script. The developer can create a script with just the Halt script step and leave it as an option under the Scripts menu. Then if a script goes awry ( like when ScriptMaker is in an endless loop ), the developer can activate the kill switch script via the menu or via a keyboard shortcut. Much better that force quitting FileMaker or pulling the plug on the computer!

FYI...
Be sure that in using the Halt or Exit script steps, you do not strand the user on an unfamiliar layout or leave them in the wrong layout mode. Always make sure the user is on the layout and in the mode (Browse or Find usually) they should be in before you Exit / Halt a script.

Got To Know Factor - 5

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2007 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Page 1 ... 15 16 17 18 19