Is it possible to "trick" my app into thinking that my numeric ID is actually text? If so, how?
Thanks
Printable View
Is it possible to "trick" my app into thinking that my numeric ID is actually text? If so, how?
Thanks
Dim x As Integer
x = 1000
MsgBox CStr(x) = "1000"
2 Ways (Assume - 4562 is the numeric ID)
1. USing CStr(4562) - Convert(cast) to String
2. Using the following format : 4562 & ""
Srinika
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
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 ).