Using MEW 9.0e on Windows 2000 Professional.
Passing in a string value greater than ‘FF’ causes this function to not respond with the anticipated value.
string is set to ’10B’, the result of this function is 10.
I do not see any restrictions in the help format as listed below:
Val( result, string ) integer function
Converts string to an integer value, stored in result.
RETURNS: 0 if no errors are detected, otherwise returns the position in the string where the error occurred. If string is empty (zero length) then 0 will be returned, and result will be set to 0.
The problem isn’t that the value is greater than 0xFF, it’s that val() is treating the string as an ASCII representation of a decimal rather than hexidecimal value and stops converting when it finds a digit other than 0-9(‘B’ in this case). I’m not sure what would happen if you tried using “0x10B” as your string instead.