Search Project Mgmt
Search FileMaker Blogs
« FILEMAKER: The PatternCount Function | Main | FILEMAKER: The Lower, Upper And Proper Functions »
Thursday
Jun212007

FILEMAKER: The Middle, Middlevalues And Middlewords Functions

From Dwayne Wright - www.dwaynewright.com

Much like the family of left functions, the middle functions are used to extract text content from a text string. However, since we are looking for middle content, the starting point is a bit more challenging.

A common way to find that elusive starting point is with (you guessed it) other text functions. In particular the PatternCount and Position funcitons. More details to come, I promise.

........................................................

Middle
Middle( text ; start ; numberOfCharacters)
FMP Version: FMP 7 and FMP 6
This function is used to pull a defined number of characters from a text string or field. Unlike the left or right functions, you can define where to start and the number of characters you want to extract. This function is commonly used in text parsing routines, where a large piece of text is broken down and placed into many different fields.

EXAMPLE: Middle ("LeSaux Media Services" , 5, 12)
This example would return a result of ux Media Ser. This is because I asked for the 5th through the 12th characters of the string LeSaux Media Services.

........................................................

MiddleValues
MiddleValues( text ; startingValue ; numberOfValues)
FMP Version: FileMaker 7
Used with return delimited text strings (often called arrays), the MiddleValues function can extract a number of those values by using a starting point and then the number of values from that point you want to return. An example probably does best in describing this function. Say you have a text field called array and on a current record it has the following data.

Lions
Tigers
Bears
Oh
My

Now if we want to get the second and third values using the MiddleValues function. You would specify the field you want to use "array", starting with the second value and gathering two values. So the calculation would look like MiddleValues( Array, 2, 2 ).

........................................................

MiddleWords
text ; startingWord ; numberOfWords)
FMP Version: FMP 7 and FMP 6
This function can return a specified number of words from a particular start word and then proceeding to the right a determined number of words.

EXAMPLE: MiddleWords ("LeSaux Media Services at www.lesaux.com" , 2, 3)
This example would return a text result of Media Service at. This is because I asked for the words of the string of LeSaux Media Service at www.lesaux.com starting at the second word and capture 3 words total.

=
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.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.
Editor Permission Required
You must have editing permission for this entry in order to post comments.