positionValue ( )

Function stats

Average user rating
166
426
9999
Support
FileMaker 10.0 +
Date posted
14 November 2019
Version
1
Recursive function
No

Author Info
 Josh Ormond

8 functions

Average Rating None

author_avatar



 

Function overview

Prototype

positionValue  ( string;   searchString;   start;   occurrence )


Parameters

string  the full string to search against.


searchString  the string to search for in 'string'.


start  numeric expression to indicate the character to start searching from.


occurrence  the occurrence of the @searchString to find.


Description

Tags:  Value   Position  

Sometimes I want the position of a value based on partial match. Similar to how the built-in function Position ( ) works. Simple function to just return the value position in a list.

Examples

Sample input

positionValue ( "ABC¶DEF¶ACB¶FED" ; "A" ; 1 ; 2 )


Sample output

3

 

Function code

/***************************************
*
*    Function Name:        positionValue ( string ; searchString ; start ; occurrence )
*    Parameters:        @string = the full string to search against.
*                    @searchString = the string to search for in @string.
*                    @start = the character to start searching from.
*                    @occurrence = the occurrence of the @searchString to find.
*    Purpose:            Provide the value's position, based on a partial match. Works same as the Position function.
*    Notes:            PositionValue ( "A¶C¶D¶B¶E¶F" ; "B" ; 1 ; 1 ) = 4
*    Change log:        2019-10-31 JO - Initial build.
*
*****************************************/

ValueCount (

    Left ( string ; Position ( string ; searchString ; start ; occurrence ) )

)

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

    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/426

    Prototype: positionValue( string; searchString; start; occurrence )
    Function Author: Josh Ormond (http://www.fmfunctions.com/mid/166)
    Last updated: 14 November 2019
    Version: 1

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

 

 

 

 

 

 

 

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)