Tabulating system
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to a tabulating system in a word processor and the like having a display, and more particularly to a tabulating system that enables the drawing of vertical and horizontal grid lines with less movements of a cursor than in a tabulating system of prior art. 
     2. Prior Art 
     There is a prior tabulating system wherein two points are specified, by a cursor on a diagonal line of a rectangular box. The two points serve as a start and an end point to draw the rectangular box surrounding a table on a screen of a display. Although this tabulating system enables the drawing of the rectangular box by specifying only two points with the cursor, it is required that respective start and end points of vertical and horizontal grid lines be specified with the cursor when they are successively drawn in the rectangular box. Therefore, there is inconvenience to the operator in operation because it is required to move the cursor from the top end to the bottom end of the box, or the left end to the right end again and again. 
     SUMMARY OF THE INVENTION 
     It is an object of the invention to provide an improved tabulating system that is designed to draw vertical and horizontal grid lines simultaneously by specifying a single point with the cursor in a rectangular box drawn on a screen of a display, to eliminate such disadvantage of the conventional tabulating system. 
     To this end, the tabulating system according to the invention comprises a key entry means, a display having a plurality of character boxes on a display screen, a memory means having a plurality of addressable memory locations at least corresponding to said character boxes, each of the locations storing flag bits for vertical and horizontal grid lines a part of attribute codes indicating display conditions of a corresponding character box, a current location counter for storing both of current horizontal and vertical locations of a cursor, a start point counter for storing both horizontal and vertical locations of the cursor at a start point when one of two end points on a diagonal line of a rectangular box to be displayed on said display screen is specified as the start point by said key entry means, an end point counter for storing horizontal and vertical locations of the cursor at an end point when another point of said end points is specified as the end point by said key entry means, and a control means for selectively setting said flag bits according to contents of said current location counter, said start point counter of said end point counter so that, when a point in said rectangular box is specified as an intersection point by said key entry means, vertical and horizontal grid lines passing through said intersection point are displayed on said display screen within said rectangular box. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 shows a block diagram illustrating a configuration of an embodiment of the invention. 
     FIG. 2 shows vertical and horizontal lines displayed at the left and the upper sides of a character box, respectively, according to two attribute bits. 
     FIG. 3 shows a pattern of a graphic cursor. 
     FIGS. 4A through 4G show the creation processes on the display screen. 
     FIG. 5 shows a correlation of contents of the start point counter, the end point counter and the current location counter. 
     FIG. 6 shows correspondence of the content of the line counter and the displayed pattern. 
     FIGS. 7A through 7D show flowcharts illustrating the tabulating procedures of the invention. 
    
    
     EMBODIMENT OF THE INVENTION 
     Now an embodiment of the invention is described referring to the attached drawings. 
     FIG. 1 shows schematically major components of a word processor suitable for embodying the invention. 
     As shown, the word processor consists of a keyboard 1, a controller 2, a main memory 3, and refresh buffer 4 and a display 5 of a cathode ray tube (CRT). 
     The keyboard 1 has a conventional configuration, and has a number of character entry keys and function keys. The function keys include a grid line mode key specifying grid line mode, a cursor movement key specifying the direction of cursor movement, an enter key used for specifying the start point, the end point, and the intersection point of grid lines, description of which keys is omitted because they are well known in the art. 
     The controller 2 processes data supplied from the keyboard 1 according to a program that is stored in a program area 10 of the main memory 3, and includes a processor 6 and counters 7-9 for storing information on the locations of the cursor. The location information of the cursor stored in the counters 7-9 is updated by the processor 6 according to keying of the cursor movement key on the keyboard 1. Operations relating to these counters 7-9 are described later in detail. 
     A logical page buffer 11 provided in part of the main memory 3 has a plurality of memory locations at least corresponding to the number of character boxes on the screen of the display 5, and stores character information and control information supplied from the keyboard 1 in a predetermined format under control of the controller 2. In other words, each memory location in the logical page buffer 11 stores a character code representing a character or a symbol to be displayed on the screen of the display 5, and an attribute byte representing an attribute (reverse, high-intensity, cursor, etc.) of said character or symbol, in a pair. However, it is assumed for convenience of the description that a vertical grid line (V) bit and a horizontal grid line (H) bit that are part of the attribute byte are stored on separate line counters 12. 
     The refresh buffer 4 has a plurality of memory locations corresponding to the number of character boxes on the screen of the display 5. Each of these memory locations stores a character code representing a character or a symbol to be displayed in each character box, and an attribute byte for the character code, in a pair. In this embodiment, it is assumed that a vertical line and a horizontal line can be independently displayed at the left side and the upper end of a character box, respectively, by using the vertical grid line (V) bit and the horizontal grid line (H) bit in the attribute byte (see FIG. 2). However, the character boxes indicated by dotted lines in FIG. 2 are not usually displayed. 
     Now referring to FIGS. 3 and 4A through 4G, what display is performed on the screen of the display 5 is described, and then the details of each component shown in FIG. 1 are described. 
     When the operator presses the grid line mode key on the keyboard 1, a grid line specifying menu is displayed on the screen of the display 5. Then, when a tabulating mode is selected on the menu, the word processor enters into the tabulating mode. In this case, a graphic cursor as shown in FIG. 3 is displayed on the screen of the display 5. The operator moves the graphic cursor to a desired location on the screen by pressing the cursor movement key, and specifies the start point and then the end point of a grid line, respectively, by pressing the enter key on the keyboard 1. When it is intended to draw a rectangular box, the start point of the grid line may be any one for the upper left, the lower left, the upper right or the lower left corners of the box. A point on a diagonal line opposed to the start point becomes the end point. In other words, one of two end points of a grid line to be displayed that is first specified is the start point, while the end point that is specified later is the end point of a grid line. In the following, it is assumed for convenience of the description that the upper left corner of the rectangular box is specified as the start point. In that case, the end point is specified by moving the graphic cursor to the right and the bottom of the rectangular box. The function up to now is the same as that in the conventional tabulating system. Then, the operator presses the cursor movement key to move the graphic cursor to a point within the previously specified rectangular box, then presses the enter key to specify it as an intersection point of vertical and horizontal grid lines to be drawn in the box. This operation is continued until the operator stops (for example, by pressing a cancel key on the keyboard 1). 
     To understand the above operation more clearly, it is described in more detail by referring to examples in FIGS. 4A through 4F. This example is to finally display a table as shown in FIG. 4G. First, the operator moves the graphic cursor to the location of the upper left corner of a rectangular box not yet displayed on the screen, and presses the enter key to specify that location as the start point (see FIG. 4A). It is noted that dotted lines in the Figure indicate the character boxes. Then the graphic cursor is moved to the lower right corner of the rectangular box, which is specified as the end point by pressing the enter key in the same manner as in the above (see FIG. 4B). Thus, the rectangular box is immediately displayed on the screen (see FIG. 4C). The graphic cursor is then moved to a point within the box, which is specified as an intersection point by pressing the enter key (see FIG. 4D). This causes a vertical line and a horizontal line passing through the intersection point to be immediately displayed in the rectangular box (see FIG. 4E). The desired table as shown in FIG. 4G is formed on the screen by successively moving the graphic cursor as in FIG. 4F, and correspondingly specifying intersection points. 
     To display the grid lines as above, the controller 2 in FIG. 1 uses the following counters: 
     Start point counter (Sx, Sy) 7 
     End point counter (Ex, Ey) 8 
     Current location counter (Cx, Cy) 9 
     Line counters (H, V) 12 
     The subscript &#34;X&#34; in the first three counters indicates the number of column from the left end of a logical page stored in the logical page buffer 11, while the subscript &#34;y&#34; indicates the number of row or line from the start line of the logical page (see FIG. 5). 
     A pair of line counters 12 are used for each of displayed lines, and one of the paired counters 12 contains the horizontal grid line bit H=1 if it is required to display a horizontal line at the upper end in each character box for corresponding displayed lines, or the other of the paired counters 12 contains the vertical grid line bit V=1 if it is required to display a vertical line at the left end (see FIG. 6). Now the tabulating procedure according to the invention is described in more detail by referring to FIGS. 7A through 7D. 
     First when the operator presses the grid line mode key on the keyboard 1, this action causes the processor 6 in the controller 2 to start the program stored in the program area 10 of the main memory 3 to display the grid line specifying menu on the screen of the display 5 (Step 20). When the operator selects the tabulating mode on the menu, the word processor enters in the tabulating mode. Then pressing the cursor movement key on the keyboard 1 updates content of the current location counter 9 according to the moving direction of the graphic cursor under control of the processor 6. In this case, when the operator specifies the start point by pressing the enter key at a desired location, the content of the current location counter 9 indicating the cursor location at that moment is set in the start point counter 7 (Step 23). Then when the end point is specified, the content of the current location counter 9 indicating the cursor location at that moment is set in the end point counter 8 (Step 26). Next, by calling S1 routine of FIG. 7C (Step 28), contents of the line counters 12, corresponding to each of line Sy to line Ey in the logical page buffer 11, are separately set. That is, all H bits for columns Sx to Ex-1 are set to be on in the line counters 12 corresponding to two lines of Sy and Ey (Steps 38 and 42), and two V bits for columns Sx and Ex are set to be on the line counters 12 corresponding to all lines from Sy to Ey-1 (steps 43 and 44). It is noted that &#34;N&#34; and &#34;M&#34; in Steps 37 and 39 of FIG. 7C indicate work areas in the main memory 3 that are used for S1 routine. 
     The processor 6 in the controller 2 read the H and the V bits set in each of the line counters 12 by a grid line creating program, and selectively sets the attribute bits representing the left vertical line and the upper horizontal line of each character box at the corresponding attribute byte locations in the refresh buffer 4 (Step 29). 
     Thus, the rectangular box as shown in FIG. 4C is displayed on the screen. Up to this stage, the procedure is the same as that of the conventional tabulating system. 
     Then, when an intersection point is specified as shown in FIG. 7B, if the content (Cx, Cy) of the current location counter 9 indicating the cursor location at that moment satisfies: 
     
         Sx≦Cx≦Ex and Sy≦Cy≦Ey (Step 33), 
    
     or if the graphic cursor indicates the rectangular box or the inside thereof, the contents of the line counters 12 corresponding to each of lines Sy to Ey in the logical page buffer 11 are updated by calling S2 routine of FIG. 7D (Step 34). The S2 routine sets all H bits for columns Sx to Ex-1  to be on in the line counter 12 corresponding to line Cy (Steps 48 thrugh 52), and sets V bits for column Cx to be on in the line counters 12 corresponding to all lines from Sy to Ey-1 (Steps 53 and 54). 
     Then, the processor 6 in the controller 2 read the content of each line counter 12 set as described above, and selectively sets the attribute bits representing the left vertical line and the upper horizontal line of each character box to be on at the corresponding attribute location in the refresh buffer 4 (Step 35). 
     By repeating Steps 31 to 35, the table as shown in FIG. 4G is ultimately displayed on the screen. 
     If an intersection point is specified to be Sx=Cx or Ex=Cx, only a vertical line is drawn in the rectangular box, while, if its specified to be Sy=Cy or Ey=Cy, only a horizontal line is drawn in the rectangular box. 
     As described, the invention enables the user to draw vertical and horizontal lines simultaneously only by specifying a point in a rectangular box with the cursor, and thus to efficiently create a table in a word processor and the like.