[ 0015 ] fig3 shows an embodiment of the present invention , which is also used as a general case for other more specific embodiments described below . fig3 illustrates the display area 300 of a display screen on a calculator , computer or hand held computing device that incorporates the features of the present invention . a spreadsheet 302 is shown within the history display or document on the display screen 300 . in the embodiment of the present invention , variables that are defined in the screen prior to the spreadsheet can be used in the spreadsheet and reflect the value assigned outside the spreadsheet , and values defined and used in the spreadsheet can be used in the display screen subsequent to the spreadsheet . for example , the variables “ a ” and “ b ” are defined in history display or document on the display screen 300 prior to the spreadsheet 302 . the variables can then be used inside the spreadsheet 302 . similarly , the spreadsheet defines a column of numbers in column “ a ”. reference to cells or variables defined in the spreadsheet can be accessed outside the spreadsheet as shown at 308 . the spreadsheet 302 can be fully integrated with the math engine that is operating outside the spreadsheet in the calculation environment 304 portion of the display area , or it can be a separately linked and embedded as described below . in another embodiment of the present invention shown in fig4 an application - based computing environment contains a spreadsheet that incorporates the features described above with reference to the display 300 shown in fig3 . an application - based calculation environment is an integrated set of applications or views that provide different ways of viewing , manipulating , or computing data . in this embodiment , the display 300 having the application - based calculation environment may be on a personal computer or handheld computing device . in this embodiment , the display containing the spreadsheet may or may not be associated with a single document . in the application - based calculation environment embodiment , the spreadsheet and other portions of the software output may appear as separate display screens as shown in fig4 . this embodiment is particularly advantages for a calculator or other hand held device with a limited display size . in this embodiment , a calculator screen 402 allows the user to perform mathematical operations including defining variable a = 3 . similarly , a spreadsheet screen 404 allows the user to perform basic spreadsheet functions on a handheld . results may be displayed on another screen such as a graph 406 . in the illustrated example , the spreadsheet defines a cell a 1 to be equal to the variable a + 2 . the calculator screen 402 then can evaluate cell a 1 as a + 2 ( or 3 + 2 ) equal to 5 as shown in the calculator screen 402 . in the application - based calculation environment embodiment illustrated in fig4 the math engine / library are integrated for all the applications of the different screens ( other variations of this embodiments described below have a separate math engine related to the spreadsheet ). therefore , symbols defined for the calculator console 408 are held in a common library 410 with the spreadsheet data 412 . in another embodiment of the present invention , the display area 300 shown in fig3 represents a heterogeneous calculator history display that contains a spreadsheet having the features described above . this embodiment would is similar to the application program called “ maple ”™ described above and as shown in fig2 but incorporating the spreadsheet features described in fig3 . in this embodiment , a spreadsheet having the characteristics described above may appear inserted into the history display of a calculator . variables defined in the spreadsheet are accessable to the calculator command line outside the spreadsheet . if the contents of the history display , including the spreadsheet are saved as a file , then the resulting file is covered by the compound document embodiment described below . in another embodiment of the present invention , the display area 300 shown in fig5 represents a compound document 502 with an integrated spreadsheet 504 having the features described above with reference to fig3 . in this embodiment , the spreadsheet &# 39 ; s data will be stored , managed , and manipulated through an api ( application program interface ) provided by the calculation system to the spreadsheet application , rather than have a separate , self - contained spreadsheet application . the spreadsheet application accesses functions to modify cell values and formulas , recalculate , move , copy , insert , delete cells and ranges , etc . by making function calls into this api . the computational core of the spreadsheet is implemented as a service in the calculation system and not in the spreadsheet application . this design facilitates the sharing of code for parsing and evaluating user inputs . each of the three previous embodiments were described with the presumption that they have an integrated spreadsheet with the remaining environment . in these embodiments , the spreadsheet &# 39 ; s data is stored , managed , and manipulated through an api provided by the calculation system to the spreadsheet application , rather than have a separate , self - contained spreadsheet application . the spreadsheet application accesses functions to modify cell values and formulas , recalculate , move , copy , insert , delete cells and ranges , etc . by making function calls into this api . the computational core of the spreadsheet is implemented as a service in the calculation system and not in the spreadsheet application . this design facilitates the sharing of code for parsing and evaluating user inputs , though there must be some additional code to support differences in behavior , such as a 1 being a cell reference in the spreadsheet environment and being an ordinary variable name outside the spreadsheet environment . outside the spreadsheet environment the operator ‘$’ can be used to distinguish cell references from ordinary variables , e . g . “$ a 1 ” to reference cell a 1 . ranges can be indicated with the operator ‘:’, e . g . “ a 1 : b 2 ” references a 2 row , 2 column range . a range may become a list or matrix to the calculation environment when used in an expression , depending on dimensions . in the above embodiments , the spread sheet used a common math engine with the other portions of the computing environment . in each of these cases another embodiment is contemplated where the spreadsheet has its own internal mathematical engine , which is separate from the mathematical engine of the computing environment or compound document in which the spread sheet resides . this variation is illustrated for the embodiment of the compound document with an embedded spreadsheet as shown in fig6 . in this embodiment , both the external mathematical engine and spreadsheet application are provided with functions defined for the purpose of retrieving external data , usually a floating point number but possibly a string , given an identifier , e . g . a 1 or a . these functions are called external data functions . if such a function is not provided to the spreadsheet or external mathematical engine , then each behaves as if the other did not exist . however , if these functions are provided , then the two components are linked , and it is a simple matter for the spreadsheet application to request data from the external mathematical engine if an unknown identifier is encountered . for example , if the cell formula for cell a 1 were “= a + 1 ”, then the spreadsheet would call the external data function provided to it to obtain a value for a . likewise , if a cell reference , e . g . $ a 1 , is encountered by the external math engine , then it can call its external data function to request a value for a 1 from the spreadsheet . since a spreadsheet must recalculate its cells in an appropriate order , formulas depending on constant cells first , then formulas depending on these formulas and so forth , it is essential that it be able to examine each cell formula and determine which cells are referenced by the formula since these cells must be calculated before the one being examined . this procedure of determining an appropriate order of cell calculation is known as topological sorting , and it poses some additional difficulties in a symbolic environment if cells can be referenced outside the spreadsheet . for example , if a variable a is defined as the sum of spreadsheet cells a 1 and b 2 , then the dependencies of a cell formula “= b 3 + a ” are not apparent on the surface . this can be handled at some expense by recursively examining the symbolic references stored in each variable . another solution is for spreadsheet references to resolve immediately to their current values when referenced outside the spreadsheet environment . so , if a = a 1 + b 2 , then the variable a contains the result of a 1 + b 2 at the time the assignment is made rather than symbolic references to these cells to be resolved later . an issue for spreadsheets is when to recalculate . for a stand - alone spreadsheet application , this is not particularly difficult since all interactions are monitored in the context of how they affect the spreadsheet . for a spreadsheet integrated into a computing environment , whether compound document or application - based , there are more considerations . generally it would be undesirable to recalculate the spreadsheet data each time a variable is modified on the off chance that it might be referenced somewhere inside the spreadsheet . in an embodiment of the present invention , spreadsheet variables accessed during a spreadsheet calculation are monitored and a recalculation is initiated only if one of these specific variables is modified . each of the symbols in the regular symbol table of the mathematical engine has a flag bit associated with it that is used to track access during spreadsheet recalculation . before recalculating the spreadsheet , these bits are cleared for all symbols in the regular symbol table of the mathematical engine , i . e ., for all the variables already defined . when a symbol is referenced during the recalculation of the spreadsheet , its bit is turned on . when the recalculation is finished , then , only those symbols actually used in the spreadsheet will have their bits turned on . for example , suppose variable a has its bit turned on and variable b does not . subsequent to the spreadsheet , if the value of b is altered or the variable c is created , it is not necessary to recalculate the spreadsheet since nothing will change . this is known because their flag bits are turned off . if the value of a is altered , however , then the spreadsheet must be recalculated to bring the spreadsheet up - to - date . in the embodiment with a spreadsheet having its own internal mathematical engine , another function can be provided to inform the external mathematical engine when spreadsheet recalculation begins and ends . [ 0029 ] fig7 illustrates a computer or hand held computing device 700 that incorporates features of the present invention . the device executes software described herein stored in memory 701 on the processor 703 . the device has a display screen 702 having a display area 704 . in this embodiment , the display is a touch sensitive display that uses a stylus for input ( not shown ). the display includes a header bar 706 that shows the current tool ( in this case a compound document editor tool called “ edit ”). the file name of the current open document on the display is also shown on the header bar (“ newdoc ”). in addition , the header bar shows an icon for closing the tool 708 and a keyboard icon 710 to bring up a “ qwerty ” keyboard on the display for input of characters with the stylus . the display area 704 further includes a top button bar 712 that has drop down menus for file , edit , insert and view functions . the display area 704 also has a bottom button bar 714 that has text formatting options , a keyboard button , and an icon 716 to pop - up another menu for inserting text symbols . although the present invention has been described in detail , it should be understood that various changes , substitutions , and alterations could be made hereto without departing from the spirit and scope of the invention as defined by the appended claims . the features that are the subject of the present invention could be incorporated into other into other computer based teaching tools and computers . similarly , other embodiments include the same user interface functionality in a rom software application package that is executed on a computer , graphing calculator or other handheld device .