I do this:
TXT_total.text=TXT_1.text + TXT_2.txt
TXT_1 = 1
TXT_2 = 2
The command do that : 12
but I want that : 3
I dont want to put a VARIABLE if possible ..
Did someone know how ??
like:
dim TXT_total.text as integer
Printable View
I do this:
TXT_total.text=TXT_1.text + TXT_2.txt
TXT_1 = 1
TXT_2 = 2
The command do that : 12
but I want that : 3
I dont want to put a VARIABLE if possible ..
Did someone know how ??
like:
dim TXT_total.text as integer
try:
TXT_total.text=CINT(TXT_1.text) + Cint(TXT_2.txt)
for your example
use the val function
TXT_total.text=Val(TXT_1.text) + Val(TXT_2.text)
Easy as.
BW :cool:
If I'm not correct, Val converts it into a double, unless you specificly declare it as Integer.
[Edited by Megatron on 09-21-2000 at 06:09 PM]Code:Dim A As Integer
A = Val(Text1)
Print TypeName(A)
Megatron, i need you to work with me, and then my code would be 100% bug free!! ;)
Once again, you spot my flaw. You are indeed correct, i didn't see the last line saying that the textline was an int, and figgered it was a string.
Well spotted. Damn my evil skim reading !!! hahahah
BW :cool:
PS i thought it would work anyway
Oh it does... and he did (declare as an int) so it all worked out.
[Edited by But_Why on 09-21-2000 at 06:18 PM]