long time no see guys haha
quick quesiton, i've completely forgotten since my vb days
i have a string containing a number, how do i put that value into an integer again? :confused:
thanks :D
Printable View
long time no see guys haha
quick quesiton, i've completely forgotten since my vb days
i have a string containing a number, how do i put that value into an integer again? :confused:
thanks :D
Just straight assignment will work, ie:
Dim c As String
Dim f As Long
c = "123"
f = c
MsgBox f
Dim tempcheck As Long
tempcheck = p.data(12)
type mismatch
data is an array of strings:confused:
then just do VAL()
or other:
CLNG
INT
CINT
If you are getting a type mismatch error than p.Data(12) contains character data and cannot be converted to a number.
CLng or CInt would cause the same error.
Val will not cause an error but the results may be incorrect.
Val("123D") - returns 123
Val("D123") - returns 0