EnforceNumeric Function | |
Make sure a variable is a numeric.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION EnforceNumeric(
u REF USUAL
) AS VOID
public static void EnforceNumeric(
ref Usual u
)
Request Example
View SourceParameters
- u
- Type: Usual
The variable to check.
If u is NIL, a value of 0 is assigned to it.
If u is not passed by reference and is not a numeric, the error system aborts the program.
If u is passed by reference but is not a numeric, the error system is called up and a value of 0 is assigned to u.
Return Value
Type:
Remarks Examples
This example uses EnforceNumeric() to ensure that an argument is a numeric, initialized to 0:
1FUNCTION Start()
2 LOCAL nOne
3 LOCAL nTwo
4 LOCAL cName
5 CheckNumbers()
6FUNCTION CheckNumbers(nOne, nTwo)
7 EnforceNumeric(@nOne)
8 Default(@nTwo, 100)
See Also