Click or drag to resize

AbsShort Function

X#
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.19
Syntax
 FUNCTION AbsShort(
	siValue AS SHORT
) AS LONG
Request Example View Source

Parameters

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

Return Value

Type: Long
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#
1LOCAL siNum1 := 100 AS SHORTINT
2LOCAL siNum2 := 150 AS SHORTINT
3? siNum1 - siNum2                // -50
4? AbsShort(siNum1 - siNum2)            //  50
5? AbsShort(siNum2 - siNum1)            //  50
6? AbsShort(-12)                    //  12
7? AbsShort(0)                    //  0
See Also