Function overview
Prototype
MiddleValues_After (
text; searchString; occurrence; include_1; StartingValue; numberOfValues )
Parameters
text
searchString
occurrence
include_1
StartingValue
numberOfValues
Description
Tags:
Value search string After
Adding the MiddleValues feature to this function now allows you to extract a number of values from a starting point after your search string
Examples
Sample input
Field Contents =
After ( _text ; _searchString ; _occurrence ; _include_bolean )
by Fabrice Nordmann, BH&A
v.2.1 Sept 2007
v.2, Mar 2007
v.1, Jan 2007
v2 adds inclusion boolean parameter.
v2.1 corrects a bug with searchstring
MiddleValues_After (YourTable::YourField ; "After" ; 1; 1 ;3;4 )
Sample output
by Fabrice Nordmann, BH&A
v.2.1 Sept 2007
v.2, Mar 2007
v.1, Jan 2007
Function code
/*
MiddleValues_After(text;searchString;occurrence;include;StartingValue;numberOfValues)
*/
/*
Orginal Function
After ( text ; searchString ; occurrence ; include_1 )
by Fabrice Nordmann, BH&A
v.2.1 Sept 2007
v.2, Mar 2007
v.1, Jan 2007
v2 adds inclusion boolean parameter.
v2.1 corrects a bug with searchstring
MODIFIED TO
MiddleValues_After(text;searchString;occurrence;include;StartingValue;numberOfValues)
Only the value on the line of the paramer value
extracts (ONLY THE VALUE IN THE LINE OF THE VALUE PARAMETER FOR THE NUMBER OF VALUUES) the end of a text, based on a search string and an occurrence number
occurrence can be positive (starting from the beginning of the text) or negative (starting from the end)
e.g.
Sample Input :
After ( _text ; _searchString ; _occurrence ; _include_bolean )
by Fabrice Nordmann, BH&A
v.2.1 Sept 2007
v.2, Mar 2007
v.1, Jan 2007
v2 adds inclusion boolean parameter.
v2.1 corrects a bug with searchstring
MiddleValues_After (YourTable::YourField ; "After" ; 1; 1 ;3;4 )
returns
by Fabrice Nordmann, BH&A
v.2.1 Sept 2007
v.2, Mar 2007
v.1, Jan 2007
see also Before, Between, and BetweenNext functions
*/
Let ([
$occurrence = Case ( not GetAsBoolean ( GetAsNumber ( occurrence )) ; 1 ; GetAsNumber ( occurrence ))
; $pos = Position ( text ; searchstring ; Case ( $occurrence < 0 ; Length ( text ) ; 1 ; $occurrence ) ; $occurrence ) + Length ( searchstring ) - 1
];
MiddleValues(Right( text ;
Length ( text ) -
$pos + GetAsBoolean ( include_1 ) * Length ( searchString )
); StartingValue;numberOfValues)
)
//MiddleValues & ; StartingValue;numberOfValues) added to the above
//Robert Schaub 02/24/2009
//starrdata
//http:starrdata.com
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/208
Prototype: MiddleValues_After( text; searchString; occurrence; include_1; StartingValue; numberOfValues )
Function Author: Robert Schaub (http://www.fmfunctions.com/mid/60)
Last updated: 26 February 2009
Version: 1.2
*/
// ===================================
/*__LITBR__MiddleValues_After(text;searchString;occurrence;include;StartingValue;numberOfValues)__LITBR____LITBR__*/__LITBR____LITBR____LITBR__/*__LITBR____LITBR__Orginal Function__LITBR__After ( text ; searchString ; occurrence ; include_1 )__LITBR____LITBR__by Fabrice Nordmann, BH&A__LITBR__v.2.1 Sept 2007__LITBR__v.2, Mar 2007__LITBR__v.1, Jan 2007__LITBR____LITBR__v2 adds inclusion boolean parameter.__LITBR__v2.1 corrects a bug with searchstring__LITBR____LITBR__MODIFIED TO__LITBR__MiddleValues_After(text;searchString;occurrence;include;StartingValue;numberOfValues)__LITBR____LITBR__Only the value on the line of the paramer value__LITBR____LITBR____LITBR__extracts (ONLY THE VALUE IN THE LINE OF THE VALUE PARAMETER FOR THE NUMBER OF VALUUES) the end of a text, based on a search string and an occurrence number__LITBR__occurrence can be positive (starting from the beginning of the text) or negative (starting from the end)__LITBR____LITBR__e.g. __LITBR__Sample Input :__LITBR____LITBR__After ( _text ; _searchString ; _occurrence ; _include_bolean )__LITBR____LITBR__by Fabrice Nordmann, BH&A__LITBR__v.2.1 Sept 2007__LITBR__v.2, Mar 2007__LITBR__v.1, Jan 2007__LITBR____LITBR__v2 adds inclusion boolean parameter.__LITBR__v2.1 corrects a bug with searchstring__LITBR____LITBR__MiddleValues_After (YourTable::YourField ; "After" ; 1; 1 ;3;4 )__LITBR____LITBR__returns __LITBR__by Fabrice Nordmann, BH&A__LITBR__v.2.1 Sept 2007__LITBR__v.2, Mar 2007__LITBR__v.1, Jan 2007__LITBR____LITBR____LITBR__see also Before, Between, and BetweenNext functions__LITBR____LITBR__*/__LITBR____LITBR____LITBR__Let ([__LITBR__ $occurrence = Case ( not GetAsBoolean ( GetAsNumber ( occurrence )) ; 1 ; GetAsNumber ( occurrence ))__LITBR__ ; $pos = Position ( text ; searchstring ; Case ( $occurrence < 0 ; Length ( text ) ; 1 ; $occurrence ) ; $occurrence ) + Length ( searchstring ) - 1__LITBR__];__LITBR____LITBR__MiddleValues(Right( text ;__LITBR__Length ( text ) -__LITBR__$pos + GetAsBoolean ( include_1 ) * Length ( searchString )__LITBR__); StartingValue;numberOfValues)__LITBR__)__LITBR____LITBR__//MiddleValues & ; StartingValue;numberOfValues) added to the above __LITBR__//Robert Schaub 02/24/2009__LITBR__//starrdata__LITBR__//http:starrdata.com__LITBR____LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/208__LITBR____LITBR__ Prototype: MiddleValues_After( text; searchString; occurrence; include_1; StartingValue; numberOfValues )__LITBR__ Function Author: Robert Schaub (http://www.fmfunctions.com/mid/60)__LITBR__ Last updated: 26 February 2009__LITBR__ Version: 1.2__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
26 February 2009