Function that returns, in numeric format, a value contained in a string.
Syntax |
real str_val (string strSrc, i32 nVal [, i32 base=10] [, i32 code=NULL]) |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
strSrc |
String in which to search for the numeric value |
||||||||||
nVal |
Specifies which numeric datum, among those that the string contains, is to be converted (if nVal=1 it will be the first numeric datum, if nVal=2 we will refer to the second, ... ) |
||||||||||
base |
Specifies the desired format for the converted value. (optional, default 10)
|
||||||||||
code |
Returns a result code for the function: (optional, default NULL)
|
||||||||||
Result |
Returns the specified numeric value (base 10) contained in the string |
||||||||||
Validity |
Rule, Task |
||||||||||
Note |
If the value specified by nVal does not match any number within the string, the returned value will be 0 and an error report will occur. The same behavior will occur if nVal < 1. If, during the search for the number to be converted, a "+" or "-" sign not followed by a number is found, code = 3 will be generated and the value returned will be 0 |
Example of use:
Altri esempi:
|