GetValue_After ( )

Function stats

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

Author Info
 Robert Schaub

2 functions

Average Rating None

author_avatar



 

Function overview

Prototype

GetValue_After  ( text;   searchString;   occurreence;   include_1;   Value )


Parameters

text  


searchString  


occurreence  


include_1  


Value  


Description

Tags:  Value   String   After  

Fabrice's original function After modified. By adding the GetValue to this function your can now extract only the row value after the string string. For example, if you enter 3 in the Value paramter it will return the value of the line 3 carriage returns from the searchString id include is 0 or the 2nd if include is 1.

Examples

Sample input

GetValue_After (YourTable::YourField ; "After" ; 1; 1 ;3 )


Sample output

by Fabrice Nordmann, BH&A

 

Function code

/*

GetValue_After ( text ; searchString ; occurrence ; include_1;Value )

*/


/*

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
GetValue_After ( text ; searchString ; occurrence ; include_1;Value )

Only the value on the line of the paramer value


extracts (ONLY THE VALUE IN THE LINE OF THE VALUE PARAMETER) 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 :

by Fabrice Nordmann, BH&A
v.2.1 Sept 2007
v.2, Mar 2007
v.1, Jan 2007

GetValue_After (YourTable::YourField ; "After" ; 1; 1 ;3 )

returns by Fabrice Nordmann, BH&A



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
];

GetValue(Right( text ;
Length ( text ) -
$pos + GetAsBoolean ( include_1 ) * Length ( searchString )
); Value)
)

//GetValue & ;Value added to the above
//Robert Schaub 02/24/2009
//StarData
//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/207

    Prototype: GetValue_After( text; searchString; occurreence; include_1; Value )
    Function Author: Robert Schaub (http://www.fmfunctions.com/mid/60)
    Last updated: 26 February 2009
    Version: 1.2

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

 

Comments

Fabrice
26 February 2009



Hi Robert, and thanks for this adaptation,
I actually use another function to accomplish this, but it's a matter of taste and habit.

BetweenNext ( _text; _searchString1; _occurrence1; _include1_boolean; _searchString2; _occurrence2; _include2_boolean )
with ¶ as _searchString2, and the number of values to extract as _occurrence2

Anyway, I'm not saying that your function is less useful, I just thought that because you were curious enough to explore After, you might like this one too.
http://www.fmfunctions.com/fname/betweennext
(Edited by Fabrice on 26/02/09 )
  General comment
Robert Schaub
26 February 2009



Hi fabrice,
I do use the Between , Before functions , but some times when picking through HTML those functions can pick up other unwanted characters or multiple substitutions need to be made.. By adding this to your original funtion, you can pick out one line item at a time.

Thanks for the original function.
  General comment
Fabrice
26 February 2009



Oh yes! now I understand the real purpose. Nice indeed! Thanks!
  General comment

 

 

 

 

 

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)