asInteger
Top  Previous  Next

val = asInteger(expr) 

Converts argument to integer.

Parameters
 
expr  
 
Any expression.  

Remarks

Use asInteger if you want to be sure that a value is integer. If a variable was not declared with Dim then it can contain value of any type and can behave in different way in expressions.  

Example


str1 = "123"  
str2 = "456"  
print str1 + str2         ' result is "123456"  
print asInteger(str1) + asInteger(str2)   ' result is 579