Page 1 of 1
A simple calculation
Posted: Tue Mar 18, 2014 12:19 pm
by AQLIVE
How do I implement the following:
A label called currency, an input field, a checkbox for up and a check box for down, and a calculated field.
I then want to input a value, check either up or down checkbox and based on the selected checkbox I want to add (if up selected) 0.00112 to the entered value or -0.00112(if down is selected)
I know it's a lot to ask but if someone could then maybe point me in the right direction.
Thanks in advance.
Re: A simple calculation
Posted: Tue Mar 18, 2014 2:40 pm
by Klaus
Hi AQLIVE,
1. welcome to the forum!
2. I highly recommend to take a look at these stack to get the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
3. Please take a look that the attached stack, should do what wou want.
I commented all scripts, so please take deep look!
Best
Klaus
Re: A simple calculation
Posted: Wed Mar 19, 2014 6:59 am
by AQLIVE
Hi Klaus and thanks you sooooooo much for that detailed explanation of how to do that simple calculation.
That really helped me alot.
I thought functions (the calculation function) should be written in the stack and not in the button.
But this makes it much simpler. Thanks a million
It it possible then to make somekind of executable / program file from that piece of code so that I can just start the calculation program instead of live code every time?
Re: A simple calculation
Posted: Wed Mar 19, 2014 12:53 pm
by Klaus
Hi AQLIVE;
AQLIVE wrote:I thought functions (the calculation function) should be written in the stack and not in the button.
But this makes it much simpler. Thanks a million

"Commonly used" should of course go into the stack or card script, but this was just a quick example
AQLIVE wrote:It it possible then to make somekind of executable / program file from that piece of code ...
Sure it is!
In Livecode go to menu "Help" and select "User Guide".
Then a PDF should open and in the PDF look for chapter: 9.1 Building a Standalone Application
That will tell you what to do
Best
Klaus