As the title, how could I convert the String into Integer in VB6?
Say:
Dim str As String
Dim num As Integer
str = "12345"
How could I set the integer value to num (12345) here ?
Thanks!
Jim Cheng
Printable View
As the title, how could I convert the String into Integer in VB6?
Say:
Dim str As String
Dim num As Integer
str = "12345"
How could I set the integer value to num (12345) here ?
Thanks!
Jim Cheng
Dim str As String
Dim num As Integer
str = "12345"
num = val(str)
dim str as string
dim num as Integer
num = CInt(str)
you might want to use IsNumeric function to check if the string is a valid numeric value first before convert it.
HTH
cksiow
http://vblib.virtualave.net - share our codes