|
-
September 25th, 2001, 02:57 PM
#1
Number to Text
Is it possible to "trick" my app into thinking that my numeric ID is actually text? If so, how?
Thanks
-
September 25th, 2001, 03:02 PM
#2
Re: Number to Text
Dim x As Integer
x = 1000
MsgBox CStr(x) = "1000"
-
September 25th, 2001, 10:02 PM
#3
Re: Number to Text
2 Ways (Assume - 4562 is the numeric ID)
1. USing CStr(4562) - Convert(cast) to String
2. Using the following format : 4562 & ""
Srinika
If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it 
-
September 26th, 2001, 09:24 AM
#4
Re: Number to Text
Well, there are some tricks to do so, like using CStr and stuff, but if it is for using as the key of a node in a treeview (I assume this cause of your previous posts), i'm affraid to disappoint you.
The treeview will just not take it, probably because it then doesn't if you are talking about the index (numeric) or the key (string), since both are passed as variant, which could be any.
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
-
September 26th, 2001, 12:11 PM
#5
Re: Number to Text
private Sub Command2_Click()
Dim temp1, temp3, temp4 as Integer
Dim temp5 as string
temp1 = 123
temp3 = 1
temp5 = ""
temp4 = 0
While temp1 > 0
temp4 = temp1 Mod 10
temp1 = temp1 - temp4
temp1 = temp1 / 10
temp3 = temp3 + 1
MsgBox (temp4)
' Convertir temp4 en char
temp5 = temp5 + Chr(temp4 + 48)
Wend
MsgBox (StrReverse(temp5))
End Sub
But the compiler does it by itself ( casting ).
Nicolas Bohemier
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
|