XstStringToNumber()  specType = XstStringToNumber (@ value$ , start , @ after , @ rtype , @ value$$ )

Convert all or part of a string into a number of natural data type.

specType = explicit type ( or -1 for numeric format error )
start = starting offset in value$ ( not modified )
after = returned with offset after last numeric character
rtype = returned with "natural data type" of value
value$$ = returned with value of number in rtype format

XstStringToNumber() converts all or part of value$ into a numeric value. It returns the numeric value in value$$ , its natural type in rtype , and any explicit type in specType . value$ can be passed by reference for faster execution.

XstStringToNumber() scans value$ from offset startOff , skips leading whitespace and unprintable characters, then converts subsequent characters into a number.

If the first of the subsequent characters cannot begin a valid number, XstStringToNumber() returns specType=-1 , rtype=0 , and the offset of the bad character in afterOff . 

XstStringToNumber() collects characters until it encounters one that is not a valid part of a number. It returns the offset of this character in afterOff , the natural type of the number in rtype , and the value of the number in value$$ .

value$$ is a GIANT number, but the numeric value stored in value$$ is not in GIANT format unless rtype=$$GIANT .

rtype is always SLONG, XLONG, GIANT, SINGLE, or DOUBLE . The final return value can be extracted from value$$ as follows:

CASE $$SLONG : value = GLOW(value$$)
CASE $$XLONG : value = value$$
CASE $$SINGLE : value! = SMAKE(GLOW(value$$))
CASE $$DOUBLE : value# = DMAKE(GHIGH(value$$), GLOW(value$$))

If specType=-1 , rtype!=0 , an rtype was returned in value$$ , but the format is suspect. Examples include:

0s7F8033jk ' 8 hex digits required after "0s"
0d3FED0000000 hi ' 16 hex digits required after "0d"
12.34d+8243 ' larger than largest number representable

If specType = SLONG , XLONG , GIANT , SINGLE , or DOUBLE , then rtype=specType , and the type was specified in the number. Examples of specified numeric types include:

0b1010010010111 ' XLONG: "0b" that fits in 32-bits
0b1010...010111 ' XLONG: "0b" that won't fit in 32-bits
0o361032723 ' XLONG: "0o" that fits in 32-bits
0o7373315631277 ' XLONG: "0o" that won't fit in 32-bits
0x12345678 ' XLONG: "0x" followed by 0-8 hex digits
0x123456789AB ' GIANT: "0x" followed by 9+ hex digits
0s3F800000 ' SINGLE: "0s" followed by 8 hex digits
0d3FE0000000000000 ' DOUBLE: "0d" followed by 16 hex digits

XstStringToStringArray()  XstStringToStringArray (@ text$ , @ text$[] )