EDIT feature TABBING EDIT feature TABBING Author: IBM tutorial formatted on 1995/04/01 06:54 for assistance contact: -------------------------------------------------------------------------------- feature NAME. TABBING TABBING Edit tabbing: Software/Hardware Edit Tabbing Edit supports three distinct types of tabbing: 1. Software tabbing. After each interaction, edit positions the cursor to a new line or to a new position in the current line. 2. Hardware tabbing. Edit will format the display so that the keyboard tab keys can be used for entering/changing columns of data. 3. Logical tabbing. A special tab character is defined which, when entered with input data, causes the data to be shifted into specified columns. Software Tabbing Each time the ENTER key is pressed, edit positions the cursor somewhere on the screen. Sometimes it is placed at the beginning of the command input field on line 2. Other times it remains at the same data position (even though the data may move on the screen). Most of the time, however, it is moved according to the rules of software tabbing. You can control software tabbing by defining software tab fields on the tabs line (displayed using the TABS line command). If no software tab fields are de- fined, default software tabbing occurs. 1. Default software tabbing 2. Controlling software tabbing Default SOFTWARE tabbing Software tabbing (or automatic cursor positioning) occurs whenever: * The cursor is in the data part of the screen. * The cursor has not been positioned by some other action, such as a FIND com- mand, an I (insert) command, or scrolling. If no software tab fields have been defined: * The cursor is moved from the line that it is on to the next line. * The cursor is always positioned at the first non-blank character of the line. In other words, if ENTER is pressed repeatedly, the cursor will move down the screen, stopping at the first non-blank character of each line. Exceptions to the rules outlined on the previous page are: 1. When an insert line (with '''''') is displayed, the cursor will always be positioned in the data part of the first insert line. 2. If a line is totally blank, the cursor will be placed under the first non- blank character of the preceding line. 3. If a line and the preceding line are both blank, the cursor will be placed over the first non-blank character of the following line. 4. If a line, and the preceding line, and the following line are all blank, the cursor will be placed at the beginning of a line. Software Tabbing Controlling Software Tabbing You can control software tabbing by using the TABS line command, and overtyping the line with software tab fields. You can think of these fields as underlining every line on the screen and thereby identifying positions on the screen where the cursor can be placed. =TABS> ---------------- ------------------ ----------- =COLS> ----+----1----+----2----+----3----+----4----+----5----+- The above example shows a tabs line with three software tab fields. If the cursor is automatically positioned by software tabbing (and not by a FIND command, or scrolling, etc): 1. The cursor will always be positioned within a software tab field. 2. The cursor will be moved from its current position to somewhere in the next field on the same line. 3. If the cursor is in or beyond the last (or only) field on a line, it will be moved to somewhere in the first field of the next line. If a software tab field consists of a single hyphen ("-") or underscore ("_"), the cursor is placed at that column position. If a software tab field is se- veral characters long, the cursor is placed somewhere within the field according to the data on the screen. The following rules are followed: 1. If there is data in the field, the cursor is placed at the first character within the field. 2. If the field is blank, the cursor is placed under the first character on the preceding line that is within the field. 3. If the preceding line is blank, the cursor is placed over the first charac- ter of the following line that is within the field. 4. If all three lines are blank, the cursor is placed in the first column of the field. These rules, while seemingly complex, tend to position the cursor near data, re- ducing the amount of manual cursor positioning that is required. Either hyphens or underscores can be used to define software tab fields. An ex- ample of a TABS line with software tab fields is: =TABS> ------------------------------ - =COLS> ----+----1----+----2----+----3----+-- If the first field covers columns 2-31 and the second field is in column 37, and if the cursor is at the end of line 1 on the screen, pressing ENTER repeatedly will: 1. Position the cursor at the first non-blank character between columns 2 and 31 on line 2, 2. Then position the cursor at column 37 on line 2, 3. Then position the cursor at the first non-blank character between columns 2 and 31 on line 3, 4. Then position the cursor at column 37 on line 3, 5. etc. Note - The TABS line also can contain asterisks (*), which define hardware or logical tab positions. The asterisks are ignored when performing software tab- bing. Hardware Tabbing Hardware tabs allow you to use the FORWARD, BACKWARD, and NEW-LINE tab keys to easily position the cursor. Normally, the edit display screen has two fields (and thus two hardware tab characters) per line. You can define additional positions where you want tab characters to be generated by using the TABS line command. Then you can acti- vate and deactivate the tab positions that you have defined, using the TABS pri- mary command. When you activate tabs you can specify whether tab characters are to be gener- ated unconditionally, or only at character positions that are blank, and you can temporarily deactivate tab characters on a specific line. If ===> tabs all is entered as a primary command, and if the tabs line looks like: COMMAND ===> TABS OFF =PROF> ....CAPS OFF....HEX OFF...NULLS ON ALL...TABS OFF COMMAND ===> TABS =PROF> ....CAPS OFF....HEX OFF...NULLS ON ALL...TABS ON =TABS> * * * =COLS> ----+----1----+----2----+----3----+----4 with hardware tabs defined in columns 10, 16, and 35, the corresponding columns of every line in which data can be entered would contain a tab character. This would allow you to use the tab keys to skip from column 1 to 11 to 17 to 36, all without any interrupts. If you wanted to type into column 35 in the above example, it would be impossi- ble (the cursor will skip right past a tab character and if you back up and try to enter data, the keyboard will lock up). You could enter a TABS OFF command to deactivate all tabs, or you can do one of the following: * Position the cursor on the attribute byte and press ENTER. * Blank out the sequence number for the line and press ENTER. Either of the above will temporarily eliminate tabs on a single line. Logical Tabbing If response time is not exceptional, software tabbing is not a practical way of entering data into multiple fields on a line. If data that is being entered will sometimes fall in a column that you have de- fined with a hardware tab character, hardware tabbing can be frustrating. For some types of data entry, logical tabbing can solve both of the above prob- lems. Logical tabbing allows you to define a special character as a tab charac- ter. Then when you enter data, you can use the special tab character and edit will shift data into tab fields that are defined on the tabs line. Enter ===> tabs ª to turn on logical tabbing and define ª as the tab charac- ter. (The tab-character consists of a single non-alphameric character. Some op- erands such as ', and " must be enclosed in quotes.) The TABS line might look like: =PROF> ....CAPS OFF....HEX OFF...NULLS ON ALL...TABS ª =COLS> ----+----1----+----2----+----3----+----4----+--- =TABS> - * * * which defines tabs fields of 1-9, 10-15, 16-35, and 36-72 and always positions the cursor in column 1 (because of the "-" in column 1) If you enter the lines: (TABS ª -- logical tabbing) 000100 ªlaª0,0ªclear counter register 000200 *ªªªto initial value Edit will reformat the data: =COLS> ----+----1----+----2----+----3----+----4----+--- 000100 LA 0,0 CLEAR COUNTER REGISTER 000200 * TO INITIAL VALUE Because ISPF is designed to be used on a display screen, logical tabbing is de- fined slightly differently than a corresponding function would be defined for a typewriter editor. The difference occurs when data is shifted into a tab field and the data is longer than the tab field. In this case, the data is moved, but the next input tab character is ignored (replaced by a blank). This difference can best be illustrated with an assembly language example. As- sume that tab fields start in columns 10, 16, and 36 and the logical tab charac- ter is ª. If you enter (TABS ª -- logical tabbing) 000100 ªGETMAINª(1),(0)ªGETMAIN STORAGE The PDF editor will reformat the data: 000100 GETMAIN (1),(0) GETMAIN STORAGE Some editors would reformat the data: 000100 GETMAIN (1),(0) Because of the way logical tabbing is handled, it is easy to use in a rote man- ner. If you start in column 1, you can enter a tab character for each tab field. If you enter TABS ON -- hardware tab requested 000100 ªLAª0,100ªSET UP SIZE OF GETMAIN 000200 ªGETMAINª(1),(0)ªGETMAIN STORAGE Edit will reformat the data: 000100 LA 0,100 SET UP SIZE OF GETMAIN 000200 GETMAIN (1),(0) GETMAIN STORAGE Both lines were entered in the same manner, with a tab character before the op code, a tab character before the operand, and a tab character before the com- ment. Note that the reformatting was done properly, even though "GETMAIN" is longer than the tab field into which it was inserted. Logical tabbing can be used to generate multiple lines from a single line of in- put. For example: If you enter TABS ON -- hardware tab requested 000100 ªLAª0,100ªSIZEªªGETMAINª(0),(1)ªGET STORAGE Edit will reformat the data: 000100 LA 0,100 SIZE 000110 GETMAIN (1),(0) GET STORAGE Note the ªª before the "GETMAIN" in the input line. The first ª causes tabbing to the start of a new line. The second ª causes tabbing to column 10. If you wanted a label starting in column 1, you could have inserted it between the two tab characters. Input data which, when reformatted, would overlay a sequence number or extend beyond the end of the record is discarded and an error message is displayed. If several tab positions are contiguous, one input tab character will skip over all of them. This is useful if the tab positions are at the beginning of the line, and you want to create several lines at one time. If you enter TABS ON -- hardware tab requested =PROF> ....CAPS OFF....HEX OFF...NULLS ON ALL...TABS ON =COLS> ----+----1----+----2----+----3----+----4----+--- =TABS> ********* * 000100 ªAª1ªBª2ªCª3ªDª4 Edit will reformat the data: 000100 A 1 000110 B 2 000120 C 3 000130 D 4