Please enable JavaScript to view this site.

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)

Value

Format

10

Decimal

16

Hexadecimal

code

Returns a result code for the function: (optional, default NULL)

Value

Description

0

Operation performed successfully

1

illegalnVal (<= 0)

2

Data not found in strSrc

3

Error during conversion

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

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC