Position()

 <  Day Day Up  >  

Position()

Category: Text

Syntax: Position ( text ; searchFor ; startingAt ; occurrence )

Parameters: text ”any expression that resolves to a text string in which you want to search; searchFor ”any expression that resolves to a text string for which to search; startingAt ”an integer representing the character number at which to begin searching; occurrence ”an integer representing which occurrence of searchFor to locate. A negative number causes the search to proceed backward from the startingAt character.

Description: Returns the character number where the searchFor string is found within the specified text string. If the searchFor string is not found, the Position() function returns a 0.

Examples:

 

 Position ("This is a test"; "is";  1 ; 1) 

Returns 3 .

 

 Position ("This is a test"; "is";  1 ; 2) 

Returns 6 .

 

 Position ("   Let (myString = "This is a test"; Position (myString; " " ; Length (myString); -1)) 

Returns 10 , which is the position of the last space in myString .

Comments:

In most cases, the Position() function is used to find the first occurrence of some substring within a string. Both the startingAt and occurrence parameters will simply be 1 in such instances.

To find the last occurrence of a substring within a string, set the startingAt parameter to be the length of the string and the occurrence parameter to be -1, indicating that the function should search backward from the end of the string for the first occurrence of the substring.

The Position() function is not case sensitive.

 <  Day Day Up  >  


QUE CORPORATION - Using Filemaker pro X
QUE CORPORATION - Using Filemaker pro X
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 494

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net