|
Lval Function |
Top Previous Next |
Function: |
Converts string representation of a value into 32-bit value (dword or long). |
Syntax: |
lval(byref sourcestr as string) as dword |
See Also: |
Part |
Description |
sourcestr |
String to convert. |
Details
Recognizes &b (binary) and &h (hexadecimal) prefixes. Can be invoked implicitly, through the dword_var= string_var expression (see example below). Compiler is smart enough to pre-calculate constant-only expressions involving implicit use of lval function.
Examples
dim d as word dim l as long dim s as string
s = "4294967295" d = lval(s) 'explicit invocation, result will be 4294967295 l = lval(s) ' d = s 'implicit invocation, result will be -1 (4294967295 -> &hFFFFFFFF -> -1 for signed variable) d = "2402" 'be calculated at compilation -- no actual lval function invokation will be here
|