FileMaker Pro

FileMaker Custom Functions

Expand FileMaker Pro with Custom Functions. Create a new custom function in FileMaker, enter the name and attributes of the corresponding bold header below, click the Select button below the text area, copy the highlighted text, and, paste it into the custom function calculation field. The code comments have usage instructions.*


GetValueIndex (valueList, valueString, matchCase, occurrence):

Retrieve the index of the matching valueString in the valueList. Returns 0 if not found. Optionally, toggle case-sensitive searching by passing a boolean through matchCase, and, search for a specific
valueString occurrence (a negative occurrence number causes backward search from the end of the valueList).

Examples:
ValueListIndex (“Alpha¶Bravo¶Charlie¶Echo”, “charlie”, False, 1) = 3
ValueListIndex (“Alpha¶Bravo¶Charlie¶Echo”, “charlie”, True, 1) = 0
ValueListIndex (“Danial¶Daniel¶Bill¶daniel¶Frank¶daniel¶Ed”, “Daniel”, True, -1) = 2


FormatDateTime ( dateValue, timeValue, format ):

Format the dateValue and/or timeValue as specified in formatString. If dateValue or timeValue are empty current date or current time are used. Optionally, use the backslash as an escape code to include text not intended to be formatted. Formatting performed using PHP date() function format codes but with FileMaker conventions.

Examples:
FormatDateTime ( 10-31-2011, “”, “D., F j, Y”) = Mon., October 31, 2011
FormatDateTime ( 10-31-2011, 11:06:53, “Y-m-d His \zulu\”) = 2011-10-31 084621 zulu
FormatDateTime ( 10-31-2011, “”, “\today is the \dS\ day\”) = today is the 31st day


FormatNumber ( number, format ):

Returns text string of number in the requested format. Function allows complete FileMaker Pro number formatting using an intuitive format structure.

Examples:
FormatNumber ( 14725.3675, “$,.2 US” ) = $14,725.37 US
FormatNumber ( -14725.3675, “$(,.2) US\r0\” ) = $(14,725.36) US [rounding off]
FormatNumber ( -14725.3675, “#,.\c255\” ) = #-14,725.3675 [text color is red]
FormatNumber ( 1, “Yes\/No” ) = Yes


* Get to the custom function management window by choosing Manage Custom Functions under the File menu.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>