MiddleValues()

 <  Day Day Up  >  

MiddleValues()

Category: Text

Syntax: MiddleValues(textToFilter ; startingValue ; numberOfValues)

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

Description: Returns the specified number of items from the middle of the textToFilter parameter, starting at the value specified in the startingValue parameter.

Examples:

 

 MiddleValues ("ABCDE"; 2; 3) 

Returns the following:

 

 B C D MiddleValues (test; 3; 1) 

Returns the following:

 

 C 

when test contains

 

 A B C D 

Comments :

The MiddleValues() function returns a slice from the middle of a return delimited array. The output itself will be a return delimited array, and there will always be a trailing return at the end of the last item.

See the LeftValues() function for a discussion of methods to remove the trailing return from the output of the MiddleValues() function.

The MiddleValues() function is used frequently in scripts to loop over the items in an array. Each time through the loop, you can extract the next value from the array by incrementing a counter. For instance:

 

 Set Field [myTable::gCounter ; 1] Loop    Set Field [myTable:gItem ; MiddleValues (myTable::myArray ; myTable:: gCounter ; 1) [ ... some set of operations involving the extracted item]    Exit Loop If [myTable::gCounter = ValueCount (myTable::myArray)] End Loop 

 <  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