Database Reference
In-Depth Information
NOTE
As you may suspect, using TextStyleRemove() with the AllStyles parameter does the exact
same thing as TextStyleAdd() with Plain . They both remove existing styling, but as you can
see above, when you add Plain , you can write neater expressions.
▪ When you add more than one style parameter, FileMaker applies them all to the text. You
can use nesting, as shown in the previous point, or simply stack them up with + signs:
TextStyleAdd ( "WARNING" ; Bold+Italic )
▪ If you take a bit of text that was formatted with a text formatting function and then send
it to another calculation as a parameter, then the formatting goes along with the text.
With the substitute function, for example, you can format text that hasn't even been
typed yet. If you add this function to a text field into which people can type letters to cus-
tomers, then it changes every occurrence of “for a limited time” to bold italic:
Substitute ( Letter ; "for a limited time" ; TextStyleAdd ( "for a limited
time" ; Bold+Italic )
Date and Time Calculations
Before you start writing date and time calculations, think about how FileMaker keeps track
of dates and times. FileMaker internally stores any date or time value as a single number that
uniquely identifies every day and time of that day. Then, when it needs to display a date or a
time, it converts the number to a value people recognize, like “11/7/2014” or “10:23 AM.”
As with other numbers that it stores one way and displays another, FileMaker does the math
on the stored value and then converts it for your convenience.
This secret to date and time storage isn't just a technicality. It actually tells you a lot about
how you can use dates and times in calculations. For example, without this knowledge, you
could spend ages trying to write a calculation that gives you the first day of the month fol-
lowing the date an invoice is due. But it's actually pretty simple:
Date ( Month ( Invoice Due Date ) + 1 ; 1 ; Year ( Invoice Due Date ) )
To break it down, you're just adding 1 to the month in question and then looking for the first
day of that month. This section tells you what you need to know to analyze this calculation
and then use its lessons in your database.
Search WWH ::




Custom Search