Hi,
I have started to learn Livecode and am getting real excited about it, but I feel that I need to have a project I can think about developing whilst I learn Livecode.
I have an idea for an app which is like a spreadsheet in that it has text boxes for cells and like a spreadsheet some text boxes will have text that the user has entered and some will display a result based on a calculation that uses a text box or uses a fixed value, or may even use a figure derived from the internet (but that will be later on).
Can Livecode handle this sort of thing, I'm sure it can but where will I need to be looking?
Thanks for any responses.
Spreadsheet like calculations
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Spreadsheet like calculations
Welcome to paradise.
LC can certainly handle this, and it is the best possible way to learn. In fact, your project is ambitious. I usually recommend an address book or calculator. LC could create a stack that works exactly like Excel, but why reinvent the wheel?
That said, you will need to learn about messages and how they are generated and trapped. You may be familiar with how a "mouseUp" message is generated when you click on an object like a button, and that is pretty easy to grasp. You will now need to consider how clicking in a field, changing the contents of that field, exiting that field, and other actions also generate messages that need to be trapped and handled.
Look up the "textChanged", "openField, "closeField", "keyDown", 'ReturnInField" and "tabKey" messages. Also the "clickText" function and its relatives. Also look up all the "see also" suggestions in each of those. Oh, and there are many other related language elements that will be useful for you.
Write back when you get stuck. The community here races to answer your questions.
Craig Newman
LC can certainly handle this, and it is the best possible way to learn. In fact, your project is ambitious. I usually recommend an address book or calculator. LC could create a stack that works exactly like Excel, but why reinvent the wheel?
That said, you will need to learn about messages and how they are generated and trapped. You may be familiar with how a "mouseUp" message is generated when you click on an object like a button, and that is pretty easy to grasp. You will now need to consider how clicking in a field, changing the contents of that field, exiting that field, and other actions also generate messages that need to be trapped and handled.
Look up the "textChanged", "openField, "closeField", "keyDown", 'ReturnInField" and "tabKey" messages. Also the "clickText" function and its relatives. Also look up all the "see also" suggestions in each of those. Oh, and there are many other related language elements that will be useful for you.
Write back when you get stuck. The community here races to answer your questions.
Craig Newman
-
- Posts: 13
- Joined: Fri May 17, 2013 9:32 am
Re: Spreadsheet like calculations
Thanks for the reply.
I'm not wanting to remake excel. Just replicate these two formulas ...
=sum(((C7+C3-(C4+C5))/C1))*100
=sum((C3-(C4+C5))/D2)
Cheers.
I'm not wanting to remake excel. Just replicate these two formulas ...
=sum(((C7+C3-(C4+C5))/C1))*100
=sum((C3-(C4+C5))/D2)
Cheers.
Re: Spreadsheet like calculations
Hi alexransome,
This is easy in liveCode.
To keep things simple name your fields the same as your cells:
That should do it 
Simon
This is easy in liveCode.
To keep things simple name your fields the same as your cells:
Code: Select all
on mouseUp
answer (((field "C7"+ field "C3"-(field "C4"+ field "C5"))/ field "C1"))*100
end mouseUp

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Spreadsheet like calculations
Hi Alex,
no need to even reinvent the wheel in Livecode, look at this fine and free library:
http://www.tapirsoft.com/#!rgrid/mainPage
And check the rest of the website, too!
Best
Klaus
no need to even reinvent the wheel in Livecode, look at this fine and free library:
http://www.tapirsoft.com/#!rgrid/mainPage

And check the rest of the website, too!
Best
Klaus