@num() Function |
![]() ![]() ![]() |
@num() function is used to convert the result of the given expression to a number. We already know that if the given parameter is a symbol we can use data type specifier 'n:' in front of the symbol name for the same purpose, but that wouldn't work if the parameter is an expression. Syntax: @num(expression [, default-number]) expression The expression whose result is subject for conversion. default-number The default value to return, in case of the expression result cannot be converted to a number. This parameter is optional and if omitted and if the result cannot be converted to a number an MScript exception occurs.
Examples: @doif( num(i:PRICE,100) > i:MAXPRICE) ... @doend()
UPDATE TABLEX SET ACTIVE = @num(f:ACTIVE,0) -- If f:ACTIVE contains a boolean value, the ACTIVE column -- will either be set to 1 or 0. WHERE ...
|