Click or drag to resize

EVL Function

X#
Returns a non-empty value from two expressions.
You can use the EVL( ) function to return an appropriate substitute value instead of an empty value, such as False (.F.) or 0, from two expressions. You can also use this functionality to remove empty values from calculations or operations where empty values are not supported or relevant.
The X# Logical value, False (.F.), and the Numeric value of 0 also evaluate to empty.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax
 FUNCTION EVL(
	eExpression1 AS USUAL,
	eExpression2 AS USUAL
) AS USUAL
Request Example View Source

Parameters

eExpression1
Type: Usual
Specifies an expression. eExpression1 can be any data type.
eExpression2
Type: Usual
Specifies an expression. eExpression1 can be any data type.

Return Value

Type: Usual
Character, Date, DateTime, Numeric, Currency, Logical, Object. EVL( ) returns eExpression1 if it does not evaluate to an empty value, otherwise, it returns eExpresssion2.
Examples
The following examples create the memory variables,
1glEmptyDate
, which contains an empty Date value, and
1glEmptyNum
, which contains an empty Numeric value, 0.
When performing EVL( ) with
1glEmptyNum
, EVL( ) returns an empty string ("") when evaluating
1glEmptyNum
and an empty string, and code"None"/code when evaluating
1glEmptyNum
and
1"None"
.
X#
1STORE {  /  /  } TO glEmptyDate
2? EVL(glEmptyDate,"")
3? EVL(glEmptyDate, "None")
When performing EVL( ) with glEmptyNum, EVL( ) returns an empty string when evaluating glEmptyNum and an empty string, and "Empty" when evaluating glEmptyNum and "Empty".
X#
1STORE 0 TO glEmptyNum
2? EVL(glEmptyNum,"")
3? EVL(glEmptyNum, "Empty")
See Also