 |
Purpose
Returns the numeric value of a string argument.
Syntax
Val (StringExpression)
StringExpression |
Any string that represents a number. If StringExpression contains the decimal point character, Val returns a floating-point value; otherwise, Val returns an integer value. |
Example
Sub Main()
'this program converts string "50" into a number and then uses the number in a math calculation
Dim s As String
Dim num As Integer
s = "50"
num = Val(s)
Print "The numeric value of 's' times 5 is: ",num *5
End Sub
|  |