What is Val in VB? In VB, val is a function that converts a numeric string into a numeric value. When it cannot be recognized as the first character of a number, it stops reading the string. Symbols and characters that are considered to be part of the value, such as the US circle number and comma, cannot be recognized. However, functions can recognize carry-in symbols & O (octal) and & H (hexadecimal ). Blank spaces, tabs, and line breaks are removed from parameters.
Val is a type conversion function:
VAL (string expression) converts a numeric string to a numeric value.
For example, VAL ("-3.85") returns-3.85.
VAL ("vb5.0") returns 0
VAL ("12 bC") returns 12
VAL is opposite to CSTR. CSTR replaces the value of a numeric expression with a string.
CSTR (125) = "125"
You still like the following:
Differences between Byval and byref in VB (example)
VB. net2008 Tutorial: Write a text encryption/decryption program