Troubleshooting

 <  Day Day Up  >  

graphics/troubleshooting_icon.jpg

Naming Variables in Let Functions

Can I use spaces in the names of variables used in Let functions? Are the variable names case sensitive? What happens if I name a variable the same thing as an existing field name or a function name ?

First off, yes, you can use spaces in the names of variables used in Let functions. Variable names can't begin with numbers , nor can they contain certain reserved characters (such as ;, \ / + - * = () [ ] < > & and "). You can, however, use characters such as $ and % in variable names. If you're accustomed from other programming languages to use $ to denote a text string, you may want to continue to use that as part of your naming convention.

Variable names are not case sensitive. You can use a particular name only once within a function, but names can certainly be reused in separate functions.

There are no restrictions against naming variables with the same names used for fields and functions. Be aware that any subsequent use of the name within the function refers to the local variable, not the field or function. With most functions, you don't need to worry about this, but names of functions that don't take parameters, such as Random , WindowNames , and Pi , should not be used for variables within a Let function. For instance, the formula Let (Pi = "Hello"; Pi) would return the string Hello , not the trigonometric constant Pi that you might expect.

Working with Arrays

I use arrays that have pipe characters as delimiters. Can I use the "values" functions to extract elements from these arrays?

The four "values" functions ( ValueCount , LeftValues , MiddleValues , RightValues ) operate only on return-delimited lists of data. If you have lists that are delimited by other characters, such as pipes or tabs, you'd first need to do a substitution to change your delimiter into a return. For example, if myArray is a pipe-delimited array, you could count the number of values in it with the following formula:

 

 Let (tempArray = Substitute (myArray; ""; ""); ValueCount (tempArray)) 

Of course, one of the reasons you might not have used returns as your delimiter in the first place is that your data elements may possibly contain return characters. If that's the case, then you can't swap in returns as your delimiters and expect the structure of the array to remain unchanged. Before turning pipe characters into carriage returns, you'd want to turn any existing carriage returns into something else ”something that's guaranteed not to be found in an element and that's easy to turn back into a return character if necessary. You might, for instance, use the Substitute function to turn returns into the string ***RETURN*** .

 <  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