I have 2 text entry fields on one card and i need to multiply them and display the result.
I need to have the result put into another field on the same card.
Obviously I am brand new to LiveCode (thursday night).
Tom
using multiply command
Moderators: FourthWorld, Klaus, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: using multiply command
Hi trags3 and welcome to the forum
Assuming you have a card with three fields and button, put the following code into the button's script
Then populate fields 1 and 2 with the numbers you want to multiply and click the button
NB: the above is about as simple as it gets and there is no error checking (for example the script relies on there being valid numbers in fields 1 and 2)
Assuming you have a card with three fields and button, put the following code into the button's script
Code: Select all
on mouseUp
put field 1 into tNumber1
put field 2 into tNumber2
put tNumber1 * tNumber2 into tResult
put tResult into field 3
end mouseUp
NB: the above is about as simple as it gets and there is no error checking (for example the script relies on there being valid numbers in fields 1 and 2)
"...this is not the code you are looking for..."
Re: using multiply command
Dave, Thanks, I got it all working very well. I appreciate the help.
Tom
Tom