![]() ZBasic System Library
336
ZBasic Microcontrollers
Type
Subroutine
Invocation
ValueL(str, val, flag)
Parameter
Method
Type
Description
Str
ByVal
String
The string from which to extract an Long value.
Val
ByRef
int32
The variable to receive the value.
Flag
ByRef
Boolean
The variable to receive a success indicator.
Discussion
This routine converts a character representation of an integral number, contained in the str parameter,
to a Long value returned in the val parameter. If the string is in an acceptable format, the flag
parameter is set to True. Otherwise, the flag parameter is set to False and the val parameter will be
0.
The string may contain any number of leading and/or trailing spaces. The value itself may consist of an
optional plus or minus sign, an optional radix indicator, and one or more digits. The supported radix
indicators are &H for hexadecimal, &O for octal and &B or &X for binary (all case insensitive). If no radix
indicator is present, decimal is assumed.
If the provided string has the proper format but represents a value that is too large or too small to be
represented as a Long, the result will be invalid but no such indication will be given.
Examples of integral values accepted by ValueL() are:
103
+123
&H55
-&B01101
Compatibility
This function is not available in BasicX compatibility mode.
See Also
Value, ValueS
|