-
April 26th, 2001, 04:46 PM
#1
How to convert String to Integer in VB6?
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
-
April 26th, 2001, 05:37 PM
#2
Re: How to convert String to Integer in VB6?
Dim str As String
Dim num As Integer
str = "12345"
num = val(str)
-
April 27th, 2001, 04:31 AM
#3
Re: How to convert String to Integer in VB6?
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
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
|