|
-
May 22nd, 2006, 06:56 AM
#1
Thread Starter
Lively Member
[RESOLVED] How to change variable integer to string variable
Hi all,
I have a variable as a number
Dim Number1 as integer
Dim Charecter1 as string
ex.
Number1= "12345"
after vb code will be
charecter1 = "12345"
which at the end i will be converting all my number variable to be as charecter varible.
Thanks in advance for your help.
-
May 22nd, 2006, 07:31 AM
#2
Re: How to change variable integer to string variable
VB Code:
Dim Number1 as integer
Dim Charecter1 as string
Number1= 12345
charecter1 = Number1.ToString()
You don't need double quotes when you assign a number. And there is bui;t in method ToString that will convert it to the string.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
May 22nd, 2006, 08:03 AM
#3
Re: How to change variable integer to string variable
out of interest is it faster to use the toString method compared with the CType() method?
Thanks
-
May 22nd, 2006, 09:22 AM
#4
Thread Starter
Lively Member
Re: How to change variable integer to string variable
 Originally Posted by Shuja Ali
VB Code:
Dim Number1 as integer
Dim Charecter1 as string
Number1= 12345
charecter1 = Number1.ToString()
You don't need double quotes when you assign a number. And there is bui;t in method ToString that will convert it to the string.
Hi ,
sorry brother is i think tostring is not for VB6
but i did fine out cstr for vb6 but i keep getting error overflow
VB Code:
Number1 = Words(Counter) <---- here where i get overflow error
T1 = CStr(Number1)
Charecter1 = T1
MsgBox T1
MsgBox Charecter1
Words(Counter) = Charecter1
'Debug.Print Words(Counter)
T = T & " " & Words(Counter)
thanks any way for you help brother.
-
May 22nd, 2006, 09:24 AM
#5
Thread Starter
Lively Member
Re: How to change variable integer to string variable
 Originally Posted by andakali
Hi ,
sorry brother is i think tostring is not for VB6 
but i did fine out cstr for vb6 but i keep getting error overflow
VB Code:
Number1 = Words(Counter) <---- here where i get overflow error
T1 = CStr(Number1)
Charecter1 = T1
MsgBox T1
MsgBox Charecter1
Words(Counter) = Charecter1
'Debug.Print Words(Counter)
T = T & " " & Words(Counter)
thanks any way for you help brother.
the words(counter) was = 14801110073
-
May 22nd, 2006, 09:27 AM
#6
Re: How to change variable integer to string variable
This is the vb.net forum.
As for vb6
VB Code:
dim inumber as integer
dim istring as string
inumber = 12345
istring = Cstr(inumber)
Will work.
http://www.vbforums.com/showpost.php...1&postcount=15
Pino
-
May 23rd, 2006, 12:21 AM
#7
Re: How to change variable integer to string variable
 Originally Posted by andakali
Hi ,
sorry brother is i think tostring is not for VB6 
but i did fine out cstr for vb6 but i keep getting error overflow 
This is VB.NET Forum and I posted VB.NET code.
Use [code] source code here[/code] tags when you post source code.
My Articles
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
|