-
Apr 19th, 2004, 07:23 PM
#1
Thread Starter
Frenzied Member
string to int
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?
thanks
-
Apr 19th, 2004, 07:27 PM
#2
The picture isn't missing
Just straight assignment will work, ie:
Dim c As String
Dim f As Long
c = "123"
f = c
MsgBox f
Remember, if someone's post was not helpful, you can always rate their post negatively .
-
Apr 19th, 2004, 07:30 PM
#3
Thread Starter
Frenzied Member
Dim tempcheck As Long
tempcheck = p.data(12)
type mismatch
data is an array of strings
-
Apr 19th, 2004, 07:31 PM
#4
The picture isn't missing
then just do VAL()
or other:
CLNG
INT
CINT
Remember, if someone's post was not helpful, you can always rate their post negatively .
-
Apr 20th, 2004, 12:49 AM
#5
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|