Multiply...

For questions about using Classic.

Post » Fri Jul 25, 2008 5:12 am

Ok, I want to do something like this: Get text from EditBox1 and multiply this number by numer got from EditBox2 and show the anserw in EditBox2, i know how to do it but i don't know which symbol i should use, * is not working.
B
3
G
4
Posts: 13
Reputation: 1,101

Post » Fri Jul 25, 2008 6:38 am

You have the symbol right, the strings in the edit boxes just need to be converted to integers or floats using 'Convert value to integer' or 'Convert value to float'. After all, you can't multiply strings together. :P
Moderator
B
99
S
37
G
19
Posts: 1,584
Reputation: 17,842

Post » Fri Jul 25, 2008 1:04 pm

try (int)EditBox1 * (int)EditBox2
B
2
S
2
G
5
Posts: 293
Reputation: 2,236

Post » Fri Jul 25, 2008 1:17 pm

Vinny was close, but the syntax is wrong. Try setting editbox2's text to:

int(Editbox1.Text) * int(Editbox2.text)

int() converts the text typed in to the edit box in to a number, which can be multiplied.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,620


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests