IsValidExpression()

 <  Day Day Up  >  

IsValidExpression()

Category: Logical

Syntax: IsValidExpression ( expression )

Parameters: expression ”a text string containing a calculation expression, or a field or expression that returns a text string that contains a calculation expression.

Description: Returns 1 (True) if the expression syntax is correct. Returns (False) if the expression has a syntax error.

Examples:

 

 IsValidExpression ("Length (SideA)") 

Returns 1 (True) as long as there is, in fact, a field named SideA .

 

 IsValidExpression ("Middle (myField ; 1)") 

Returns (False) because the Middle function requires three parameters to be considered valid syntax.

 

 IsValidExpression (myFormula) 

Returns 1 (True) if the contents of myFormula would be considered a valid calculation expression.

Comments:

The IsValidExpression() function is often used in conjunction with the Evaluate() function to ensure that Evaluate() is passed a valid expression. For instance, if users are allowed to enter a formula into a field called myFormula , and you want to have another field express the results of that formula, you could use the following:

 

 If (IsValidExpression (myFormula) ; Evaluate (myFormula) ; "Invalid formula: " & TextColor graphics/ccc.gif (myFormula ; RBG (255 ; 0 ; 0))) 

An expression is considered invalid if it contains syntax errors or if any of the referenced fields cannot be found. Errors that might occur only during execution of the expression, such as record access restrictions, are not detected by the IsValidExpression() formula.

 <  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