EVL Function | |
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.19
Syntax FUNCTION EVL(
eExpression1 AS USUAL,
eExpression2 AS USUAL
) AS USUAL
public static Usual EVL(
Usual eExpression1,
Usual eExpression2
)
Request Example
View SourceParameters
- 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,
,
which contains an empty
Date value, and
,
which contains an empty
Numeric value, 0.
When performing
EVL( ) with
,
EVL( ) returns an empty string ("")
when evaluating
and an empty string,
and code"None"/code when evaluating
and
.
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".
1STORE 0 TO glEmptyNum
2? EVL(glEmptyNum,"")
3? EVL(glEmptyNum, "Empty")
See Also