EVAL_VALID()

Syntax

Result_Flag as L = EVAL_VALID( Expression as C [, Context as C ] )

Argument

Description

Expression

A quoted Xbasic statement.

Context

Optional.  The context in which the expression should be evaluated. This can be a list of tables in a CR-LF delimited list. It can also be the name of an open form (suffixed by ".this"), which would evaluate the expression in the context of the form.

Description

EVAL_VALID() evaluates Expression and returns .T. (TRUE), if Expression is valid (can be interpreted as Xbasic code), or .F. (FALSE) if the Expression is invalid. This function is useful when the expression to be evaluated is itself constructed by another expression.

Supported By

Alpha Five Version 5 and Above

Examples

Assume that varA = 1, and varB = 2. Assume that theExpression = "varA + varB" :

eval_valid("1 + 2") -> .T.

eval_valid("varA + varB") -> .T.

eval_valid(theExpression) -> .T.

eval_valid("date() ")-> .T.

eval_valid("daaate() ")-> .F.

For more examples on how the Context parameter is used, see EVAL().

See Also

Expression Evaluation Functions, EVAL()