MiddleValues_After ( )

Function stats

Average user rating
60
208
9999
Support
FileMaker 8.5 +
Date posted
26 February 2009
Last updated
27 February 2009
Version
Recursive function
Yes

Author Info
 Robert Schaub

2 functions

Average Rating None

author_avatar



 

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: 27 February 2009
    Version: 1.2

*/
// ===================================

 

Comments

Robert Schaub
27 February 2009



Original post was missing a parameter. Added parameter occurrence and change parameter include to include_1. My bad, sorry and I hope I didn't mess anyone up.
 Bug report

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (32)
Date  (28)
XML  (27)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (13)
Filter  (12)
Layout Objects  (11)
Design  (10)
Array  (8)