Posted By
SVS on 2009-07-01 07:34:46
| Re: SVS Calc
To MagerValp and who is interested:
The structures of data in SVS-Calc are the following: - Cells' data: a bimensional string array (columns x rows) - Formulas: an array with (n x 4) elements. "n" is the index; 0, 1, are column and row where formula resides, 2 is the text of formula, 3 is the formula converted into RPN tokens; - Formats of data visualization: a bimensional integer array (columns x rows) with flags: 1=centered, 2=right justified, 3=number (using); 4=none, 5=date/time (using). Value is negative to set cell as protected. - Column sizes: integer vector (26 elements) - Colors: integer array (6 x 2). Second value is: 0=color 1=luminance. - Remaining strings for cell propagation feature: string vector (17 elements).
The main challenges were the following: - Evaluation of formulas. I used the RPN (Reverse Polish Notation) method, after have modified its standard algorythm in order to manage operands longer than one character (like functions) in addition to standard math operators (* / - + ^). When a formula is entered it is parsed and translated into sorted RPN tokens so that further recalculations have not to re-analyze it again, but only execute it. - Engine for autoadapting referrals of formulas. It applies to all existing formulas of the sheet after you inserted/deleted a new cell (or column, or row), and after you copied/cut a cell with a formula. There may be a lot of different cases, so that I had to build a method able to "understand" what it has to do and where. (For example a formula could have one or more referrals to modified locations and one or more referrals to non-modified locations. Furthermore its location can define if it has or not to be fixed).
I hope you find this info useful and interesting, have you questions?
|