Click or drag to resize

AbsShort 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 AbsShort(
	siValue AS SHORT
) AS LONG
View Source

Parameters

siValue
Type: Int16
The 16-bit integer to evaluate.

Return Value

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