Click or drag to resize

AbsLong Function

Return the absolute value of a strongly typed numeric expression, regardless of its sign.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION AbsLong(
	liValue AS LONG
) AS LONG
View Source

Parameters

liValue
Type: Int32
The 32-bit integer to evaluate.

Return Value

Type: Int32
A positive number or 0.
Remarks
AbsLong() is the same as Abs() except that it is strongly typed.  For more information, see Abs().
Examples
These examples show typical results from AbsLong():
X#
LOCAL liNum1 := 100 AS LONGINT
LOCAL liNum2 := 150 AS LONGINT
? liNum1 - liNum2                                // -50
? AbsLong(liNum1 - liNum2)                        //  50
? AbsLong(liNum2 - liNum1)                        //  50
? AbsLong(-12)                                        //  12
? AbsLong(0)                                        //  0
See Also