LeftValues()

 <  Day Day Up  >  

LeftValues()

Category: Text

Syntax: LeftValues (textToFilter ; numberOfValues)

Parameters: textToFilter ”a return-delimited text string or expression that returns a return-delimited text string; numberOfValues ”any positive number or expression that returns a positive number.

Description: Returns the specified number of items from the beginning of the textToFilter parameter.

Examples:

 

 LeftValues("ABCDE";3) 

Returns the following list:

 

 A B C LeftValues (WindowNames;1) 

Returns the name of the active window.

Comments:

The LeftValues() function returns the first n items from a return-delimited array. The items will themselves be a return-delimited array, and there will always be a trailing return at the end of the last item.

You can remove the trailing return in a number of ways. If you are extracting a single item from the beginning of a list, you can use the Substitute() function to remove any return characters ”for instance, Substitute (LeftValues (text ; 1) ; " " ; "") . You would not use this method when returning multiple items because the internal delimiters would be lost as well. Instead, the following function returns everything except the last character of the extracted list:

 

 Let (x = LeftValues (text; n) ; Left (x ; Length (x) - 1)) 

Another option is the following:

 

 LeftWords (LeftValues (text ; n) ; 999999) 

This function takes advantage of the fact that the LeftWords() function ignores any leading or trailing delimiters. Be aware that this function also ignores leading or trailing delimiters (including punctuation symbols) from the actual items in the array, so in some cases this function does not return the desired result. The safest function to use in all cases is the Let() function (described ahead).

 <  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