Tuesday, August 31, 2010

Visual Basic Math Function : Val

Purpose : The Val function returns the numeric value of the supplied string expression.

Syntax :
Val ( strExpression )

strExpression : String for which you want to return the numeric value

A! = Val ( "123" )
B! = Val ( "1 2 3" )
C! = Val ( "123Sam" )
D! = Val ( "A" )

First Three example line assign a value of 123 to their respective variables but fourth line return 0

No comments:

Post a Comment