Method for controlling the order of editing cells in a spreadsheet by evaluating entered next cell attribute of current cell5121499Abstract A mechanism allows for programming the order of cells for an operator to enter data in a spreadsheet. Each cell of the spreadsheet may be provided with a "next cell" attribute, and these attributes as well as other attributes for the cells are stored in a table. The "next cell" attribute may be a constant, such as the name of the next cell, or it may be a logic expression so that the next cell to be edited can be different depending on some condition. When the operator presses the NEXT CELL key, the "next cell" attribute is searched by accessing the attribute table, and if a "next cell" attribute is found, it is evaluated to determine the next cell to be edited. Claims Having thus described my invention, what I consider novel and desire to secure by Letters Patent is set forth in the following claims: Description The invention disclosed in this application is related in subject matter to the inventions disclosed in the following patent applications which are assigned to the assignee of this application:
______________________________________
PROCEDURE main:
************************************************
* PURPOSE: Control the order of editing cells in
*
* the spreadsheet. *
************************************************
Position the operating point to the first cell to
process.
WHILE editing is to be done DO
Edit the current cell.
IF edit next cell is requested THEN
Call FIND.sub.-- NEXT.sub.-- CELL.
If no error in finding next cell THEN
Position operating point to the cell
returned by FIND.sub.-- NEXT.sub.-- CELL.
ELSE
Post an error message indicating that the
"next cell" expression is in error.
ENDIF
ELSE
Process depending on method to use when "edit
next cell" is not requested.
ENDIF
ENDWHILE
______________________________________
FIG. 5 is the flow chart for the main procedure. This is the procedure that is in effect at the time the spreadsheet is being edited. The first cell to be processed, as determined by the system, is used as the cell to which the operating point is initially positioned, as indicated by block 11. The initial condition of spreadsheet editing is that this first cell is to be edited, so the system determines that there is more editing to do, as indicated by decision block 12, and begins the process of editing the cell in block 13. After the cell has been edited, the system must determine whether the next cell to edit is identified by the Next Cell property of the current cell. This is indicated by decision block 14. If not, then as indicated in block 16, the normal processing determines the next cell to edit, which could be dependent on the direction of cursor movement or an explicit selection by pointing. The process loops back to decision block 12, and it may be that at this time editing is complete. If this were the case, the process exits. However, on the other hand, if the Next Cell property is found in decision block 14, then a procedure is called to identify which cell is to be edited next. This is the function indicated in block 15. After the procedure is executed, a test is made in decision block 17 to see if an error condition exists. If not, then the identified cell is made the current cell as indicated in block 19. If an error occured, an error message is posted as indicated in block 18, and the current cell remains unchanged. In either case, the procedure loops back to decision block 12. The PDL code for the procedure FIND.sub.-- NEXT.sub.-- CELL is listed below.
______________________________________
PROCEDURE FIND.sub.-- NEXT.sub.-- CELL
************************************************************
* PURPOSE: Find the next cell by using the "next
*
* Cell" attribute. *
* INPUT: Current cell location in the
*
* spreadsheet. *
* OUTPUT: Return code indicating if a valid
*
* next cell was found. The next cell
*
* to edit. *
************************************************************
Locate current cell attributes.
Find the "next cell" attribute.
Call EVALUATE.sub.-- NEXT.sub.-- CELL.
IF a valid next cell found THEN
Set return code to "valid cell found";
Set next cell to edit to cell returned from
EVALUATE.sub.-- NEXT.sub.-- CELL;
ELSE
Set return code to "valid cell not found";
ENDIF
______________________________________
The flow chart for the procedure FIND.sub.-- NEXT.sub.-- CELL is shown in FIG. 6. This procedure is called to determine the next cell to edit as specified in the Next Cell property of the current cell. The current cell attributes are located and the Next.sub.-- Cell attribute is located as indicated in block 20. The value for this attribute is a string that was specified by the operator through keying, pointing or some other means. This string is evaluated by calling the EVALUATE.sub.-- NEXT.sub.-- CELL procedure to parse the string and derive the identity of the next cell to edit as indicated in block 21. This procedure returns an error indicator which is tested in decision block 22. If the error indicator is true, then an invalid return code is returned to the calling program as indicated in block 23. On the other hand, if the error indicator is false, the identified cell can be returned to the calling program as indicated in block 24. The PDL code listing for the procedure EVALUATE.sub.-- NEXT.sub.-- CELL is listed below.
__________________________________________________________________________
PROCEDURE EVALUATE.sub.-- NEXT.sub.-- CELL
**************************************************************************
***********
* PURPOSE: Evaluate the "next cell" attribute expression.
*
* INPUT: Pointer to and length of the expression.
*
* OUTPUT: Return code: *
Valid cell found
*
*
Valid cell not found
*
* Cell identifier (if valid cell found).
*
* SYNTAX: The following is the set of syntax
*
* diagrams for the expression.
*
* *
* Expression: *
* * *
##STR1## * * *
* *
* If Statement: *
* * * * * * * * * * *
##STR2## * * * * * * * * * * *
* *
* Boolean Expression: *
* * * * * * * * * * * * * * *
##STR3## * * * * * * * * * * * * * *
*
* *
* Simple Expression: *
* * * * * * *
##STR4## * * * * * * *
* *
* Term: *
* * * * * * * * * * *
##STR5## * * * * * * * * * * *
* *
* Factor: *
* * * * *
##STR6## * * * * *
* *
* Unsigned Constant: *
* * * * * * * * *
##STR7## * * * * * * * *
* Integer Number: *
* * *
##STR8## * * *
* *
* Real Number: *
* * * * * * * * * * *
##STR9## * * * * * * * * * * *
* *
* Cell: *
* *
##STR10## * *
**************************************************************************
****** **************
IF the expression with an "if statement" THEN
Evaluate the boolean expression
IF there is a syntax error in the boolean expression
THEN set the return code to valid cell not found
ELSE
IF the boolean expression evaluated "true"
THEN call EVALUATE.sub.-- NEXT.sub.-- CELL with the string
between the "then" and "else"
Pass back the return parameters returned
from EVALUATE.sub.-- NEXT.sub.-- CELL
ELSE
Call EVALUATE.sub.-- NEXT.sub.-- CELL with the string
after the "else"
Pass back the return parameters returned
from EVALUATE.sub.-- NEXT.sub.-- CELL
ENDIF
ENDIF
ELSE
Check the remainder of the string for a valid cell syntax
IF a valid cell syntax was found
THEN return the cell name
Set the return code to valid cell found
ELSE
Set the return code to valid cell not found
ENDIF
ENDIF
__________________________________________________________________________
The flow chart for the EVALUATE.sub.-- NEXT.sub.-- CELL procedure is shown in FIG. 7. This procedure examines the input string to determine the cell to be identified according to the syntax rules of the Next Cell attribute. The syntax is described in the PDL code given above for this procedure. First, a test is made in decision block 25 to determine if an "IF Statement" is contained in the string. If there is not an "IF Statement" in the string, then the remainder is examined in block 26 for valid syntax of a specific cell. In decision block 27, a test is made for a valid cell syntax. If a valid cell syntax is not found, then a return parameter is passed to the calling program indicating that a valid cell was not found as indicated in block 29. On the other hand, if a valid cell syntax is found, then a return parameter is passed to the calling program indicating that a valid cell was found and the name of the cell as indicated in block 28. In the case where the "IF Statment" is found in decision block 25, the boolean expression of the statement is evaluated as indicated in block 30. Since the expression may be in error, a test is made in decision block 31 so that a return parameter can be passed to the calling program to indicate that a valid cell was not found as indicated in block 32. If no error occured, then the expression evaluated is either True or False. This is tested in decision block 33. If the expression is True, then the following portion of the string between the THEN and ELSE parts of the IF statement is to be evaluated recursively by this same procedure as indicated in block 35. In the case where the expression is False, the portion of the string after the ELSE is to be evaluated as indicated in block 34. In either case, the return parameters from the recursive call are returned as the parameters to the calling program as indicated in block 36. While the invention has been described in terms of a preferred embodiment, those skilled in the art will recognize that the technique employed may be modified and used without departing from the scope of the invention.
|
Same subclass Same class Consider this |
||||||||||
