The Calculation dialog allows developers easy access to the data fields in their solutions and to a complete function list (see Figure 4.1).
Figure 4.1. Both field names and calculation templates can be double-clicked to insert them into the expression editing area.
If you'd like more detail on calculations including complete examples of how they work, see Chapter 6, "Calculation Functions." |
Calculations: Things to Remember
When working with calculation fields and the various places within FileMaker that make use of calculation functions, there are some common issues to keep in mind:
& |
Concatenates the result of two expressions. 1 & 2 will result in "12". |
"" |
Designates literal text. |
¶ |
Carriage return. |
() |
Designates a function's parameter list and controls the order of operations for math expressions. |
2
This is also true for >= and <= for and images/U2264.jpg border=0>, respectively.
[View full width]
// this is a one-line comment, designated by two forward-slash characters /* this is a multi-line comment designated in a block by a beginning forward-slash-asterisk and closed by an ending asterisk-forward-slash. */Case ( fieldOne; "true"; "false" ) Case ( (IsEmpty (text) or text = 0); "false"; "true")
Please note that the authors do not recommend this shortcut as a best practice. We tend to believe one should write explicit (and, yes, more verbose) code, leaving no room for ambiguity.
Case ( fieldOne; "true" ) Case ( fieldOne = 1; "one"; fieldOne = 2; "two" ) Case ( fieldOne = 1; "one"; fieldOne = 2; "two"; "defaul" )
We strongly recommend you always provide a default condition at the end of your Case statements, even if that condition should "never" occur. The next time your field shows a value of "never happens", you'll be glad you did.
Case ( 1 = 2; "one is false"; 1 = 1; "one is true"; 2 = 2; "two is true" )
Quantity[2] GetRepetition ( Quantity; 2 )
Get(ApplicationLanguage)
Get(DesktopPath)
Get(DocumentsPath)
Get(FileMakerPath)
Get(PreferencesPath)
Get(PrinterName)
Get(SystemDrive)
Get(SystemIPAddress)
Get(SystemLanguage)
Get(SystemNICAddress)
Get(UserName)
: FileMaker Specifications
FileMaker 8 Product Line
Specifications and Storage Limits
Field Types and Import/Export Formats
: Calculation Functions
Working with Calculations Primer
Calculation Signatures
Calculation Functions
: Custom Functions
Custom Functions Primer
Useful Custom Functions
: Script Steps
Scripting Primer
Script Step Reference
: Quick Reference
FileMaker Error Codes
FileMaker Keyboard Shortcuts
FileMaker Network Ports
FileMaker Server Command Line Reference
FileMaker XML Reference
: Other Resources
Where to Go for More Information