Share this Page URL

Chapter 14. Specialized Calculation Func... > Text Formatting Functions - Pg. 372

Specialized Calculation Functions 372 Figure 14.14. Using the LookupNext function, you can create a calculation field in the Person table that contains information from the "next lowest" matching record. It would have been possible in the previous examples to match to the EndDate instead of the StartDate. In that case, you would simply need to match to the next higher instead of the next lower matching record. An entirely different but perfectly valid way of approaching the problem would have been to define a more complex relationship between Person and Zodiac, where the DateMatch was greater than or equal to the StartDate and less than or equal to the EndDate. Doing this would allow you to use the fields from the Zodiac table as plain related fields; no lookup would have been required. There are no clear advantages or disadvantages of this method over the one discussed previously. NOTE Other typical scenarios for using LookupNext are for things such as shipping rates based on weight ranges, price discounts based on quantity ranges, and for defining cut scores based on continuous test score ranges. Text Formatting Functions In previous versions of FileMaker Pro, there was no way to affect the display of a field (that is, color, size, font, style) via calculation formulas. Developers had to come up with workarounds for seem- ingly simple tasks, such as having the contents of a field change color based on some conditional test. For example, a typical workaround was stacking two calculation fields on top of one another, each formatted with a different text color on the layout, and then having a conditional test in each turn it "on" or "off" to simulate the effect of the text changing color. In FileMaker Pro 7, six new text formatting functions obviate the need for many of these old work- around options. They are each discussed in detail in Appendix B, but here we demonstrate some examples of how and why you might use these functions. Text Color, Font, and Size The TextColor, TextFont, and TextSize functions are quite similar. The first parameter of each is the text string that you want to act upon; the second parameter contains the formatting instructions you want to apply.