Hello, i am programming a spreadsheet as my assignment. I have done it but the last step is to make it so uncalculated cells linked to other uncalculated cells need to be calculated. meaning if A1 hold the formula A1 = a2+a3 and if A3 in turn holds another formula it needs to be calculated first. this has made me rethink my whole assignment. Can someone show me how to develop a simple spreadsheet console program which does that.

Recommended Answers

All 2 Replies

So why can't you recursively evaluate A -> B -> C ?

a1 = eval( eval(a2) + eval(a3) );

When you get to a3, you see that you need to do another eval()

Is this a plan?

The only problem you need to watch out for is if there is a cycle in the expressions.

i forgot to post the code, :(. well basically a is a string, which has a formula which calls other cells. will post code when i get home so you can get a better look at what i am talking about

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.