LeftValues()

Category: Text

Syntax: LeftValues ( text; numberOfValues )


Parameters:

textA return-delimited text string or expression that returns a return-delimited text string.

numberOfValuesAny positive number or expression that returns a positive number.

Data type returned: Text

Description:

Returns the specified number of items from the beginning of the text parameter.

The LeftValues() function returns the first n items from a return-delimited array, where n is the number specified in the text parameter. 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 charactersfor 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).

Examples:

Function

Results

LeftValues("A¶B¶C¶D¶E";3)

Returns the following list:

 

A

 

B

 

C

LeftValues (WindowNames;1)

Returns the name of the active window.




: FileMaker Specifications

FileMaker 8 Product Line

Specifications and Storage Limits

Field Types and Import/Export Formats

: Calculation Functions

Working with Calculations Primer

Calculation Signatures

Calculation Functions

: Custom Functions

Custom Functions Primer

Useful Custom Functions

: Script Steps

Scripting Primer

Script Step Reference

: Quick Reference

FileMaker Error Codes

FileMaker Keyboard Shortcuts

FileMaker Network Ports

FileMaker Server Command Line Reference

FileMaker XML Reference

: Other Resources

Where to Go for More Information



FileMaker 8 Functions and Scripts Desk Reference
FileMaker 8 Functions and Scripts Desk Reference
ISBN: 0789735113
EAN: 2147483647
Year: 2004
Pages: 352

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