XV-1 XV. EDIT - An Editing Subroutine E. Ricardo Quinones 1. General Description EDIT is an editing subroutine that operates under BATMAN, using BATMAN's provisions for input/output and serialization. written entirely in FAP and operates under FMS. It is Whereas BATMAN is designed to deal with whole card images at once, EDIT is intended to be used to handle single characters and words within card images. EDIT and BATMAN have radically different control languages that are mutually unintelligible; at the end of a BATMAN-EDIT run, the listing of control cards distinguishes between BATMAN control cards and EDIT control cards by indenting the cards interpreted by EDIT, EDIT contains provisions for maintaining whole-rcard integrity, if desired, or for packing as many words of text as possible into as small a space as possible. This option is called "squeezing", because when the Q switch (see below — section 3, part C) is 'ON', consecutive blanks are squeezed together into a single blank. Also, words that are hyphenated in the input stream may be reintegrated in the process of editing. This reintegration only occurs when a word is hyphenated across a card boundary in the input stream, and it is regulated by the H switch (see section 3, part C) in conjunction with the aforementioned Q switch. Input to EDIT is in the form of 80-character card images. The first 72 characters of each card image are "input text", and the last XV-2 8 characters are "serialization". An implicit blank is assumed after the input text of each card image, so that non-blank characters in column 72 of the input text are not ordinarily concatenated with the contents of column 1 of the succeeding input text card. Section 3, part C deals with exceptions to this as provided by the H switch. Output is in 80-character card images, and again the format is 72 characters of processed text, followed by 8 characters of serialization. Words are never broken across card boundaries. Certain character strings may be forced to the beginning of card images on output; provisions for defining such character strings are explained further on, in section 3, part C. Generally speaking, "keywords" are forced to the beginning of card images when they are found at the beginning of card images on input, while the special character defined by a minus-7-8 punch (octal 57 internally on the 7094) is used to force any set of characters to the beginning of a card image, no matter where the characters occur in the input stream. Most of the limitations of EDIT regarding table sizes and other machine-related specifications are shared with BATMAN 2. Requirements and Specifications for BATMAN. All of the input/output specifications for any EDIT run must be made in BATMAN; all of BATMAN's default specifications save one are applicable to EDIT. That is, before any editing can be done, the following input tape, output tape and output blocking must be specified in BATMAN: XV-3 procedure, serialization procedure, whether output is or is not to be printed concurrently on the system output tape, and whether or not "*STOP" and end-of-file (eof) markers are to be copied. In case any of these specifications is omitted, the following default specifications are adopted: input tape — 10 (B5 under FMS); output tape — 9 (A5), with blocking; serialization procedure — copy previous serialization; concurrent printing of output — none; "*ST0P"s and eofs — copied. The exception to this standard procedure in EDIT is in the serialization procedure. If control is passed to EDIT while BATMAN is reserializing the output, either by a standard increment or by *TEXT numbers, then EDIT allows this to continue. If, on the other hand, EDIT is presented with specifications for blank serialization or for copying the old serialization, EDIT overrides this by establishing a specification which takes the serialization on the first card read in as a base, and an increment of 10, and reserializing the output. error. No message is printed, and this is not counted as an here is that editing very often produces card The rationale images that do not at all resemble the original input images, and to copy old serialization would only be misleading. Blank serialization is not allowed because there would then be no way to perform further eding on subsequent runs, as there would be no way to identify specific cards for editing commands. If blank serialization is desired after an editing job is done, the output must first be written onto a scratch tape and then copied onto the final output tape under a "DO NOT SERIALIZE" command for BATMAN. XV-4 Control is passed from BATMAN to EDIT by using the single control word "EDIT" on a BATMAN control card. If any other of BATMAN'S control words (such as INPUT, OUTPUT, TAPE, FILE, CARD, PRINT, BLOCKED, and so on) appears on the same control card as "EDIT", the control card will be considered illegitimate and control will not be passed to EDIT. Control can be passed from EDIT to BATMAN in two ways. First, if an EDIT control card containing the character R in column 1 is found, EDIT will unburrer its work spaces and pass control immediately to BATMAN. Second, unbuffering and the relinquishing of control is automatic upon the occurrence of an end-of-file mark in the input stream. This serves as a safeguard against The eof return to BATMAN the involuntary merger of distinct files of data. can be deliberately invoked by an EDIT control card with the character F ^ in column 1; editing, using all current P, X, and K cards (see below), merely continues until an eof is found. When control is returned to BATMAN, EDIT's various counters and registers are not zeroed; the only change in EDIT's internal condition is the emptying of its buffer space. However, if EDIT has overridden a BATMAN serialization specification, EDIT f s new specification remains in effect when control is returned to BATMAN. EDITfs error messages are included in BATMAN'S count of errors committed in any given run. "BAD INPUT" flags are attached to all cards which are inputted to EDIT as part of a redundant record, and these are also included in BATMAN's error count, with each card counted as an error, rather than each record. Note that these flags are carried with each character of each redundant record, so that if any editing increases or XV-5 decreases the amount of space occupied by redundant text, "BAD INPUT" flags may be eliminated or dispersed. to the convention followed by BATMAN. Whereas BATMAN operates one card image ahead of where the user thinks it is, EDIT operates exactly where the user supposes it to be, although output lags by roughly one card image, because EDIT must keep enough "stock on hand" to match the longest possible strings across card boundaries, All this is essentially similar 3. EDIT Control Card Format A) Serialization EDIT control cards are interpreted and their commands executed when a text card is found with serialization in columns 73-8Q that matches the serialization in columns 73-80 of the control card. Blanks are converted to zeroes, so "bbbl0050" matches "00010050", which in turn matches "0001bb50", and so on. With this exception, the control A card serialization must match exactly the input serialization. control card numbered "00010025" will never be executed if the serialization runs"..., 00010010, 00010020, 00010030, 00010040,...". Since searching is only carried out in a forward direction (in terms of tape motion), in the previous example, the editing process would continue while EDIT searches for a card numbered "00010025", until the eof marker is encountered. to BATMAN. At that time, control would be returned EDIT does not consider the numerical value of the serialization number; that is, no judgment is ever passed on the XV-6 prospective location of a card with a given serialization number. The tape is merely moved forward until a card with a matching serialization is found; or an eof encountered. This is unlike BATMAN's technique, which will backspace along an input tape to find a text card with a lower serialization number than the text card presently under consideration. If the control card has a blank serialization field, the command is carried out on the card image most recently read in. Therefore, many different actions may be performed on a single card of text by locating the text card with the serialization number on the first control card, and by leaving columns 73-80 blank on succeeding control cards. The same effect can be obtained by repeating the same serialization number on consecutive control cards. Text cards are usually read in for editing after the serialization number on the control card has been read; if, however, the serialization number on the control card is found to match the serialization number of the most recently acquired text card, no additional text is read in. The order of treatment of the various parts of the control card and text cards is as follows: 1) A control card is read in; the control card serialization is converted and matched against blanks and against the present text card. If either of these matches succeeds, control goes to "3)" below. 2) If the matches do not succeed, the permanent editing commands are performed (see below) and another text card is read in. Control reverts to "1)" above. XV-7 3) If the control card and the text card have matching serialization numbers, or if the control card serialization is blank, the body of the control card is interpreted and the command executed. to "1)" above. Control reverts B) Editing Commands The most basic command used in editing text requires the replacement of a character string with another character string. Under EDIT, this is accomplished by a command which resembles a FORTRAN assignment statement. Beginning in column 1 of the control card, the string to be, searched for is specified by enclosure within single quote marks. definition, see below). (For a more complex discussion of string Immediately following this, one and only one = (equals sign) must appear to separate this "search string" = from its "replace string". No blanks or any other characters The sequence of characters that will are allowed between strings. replace the search string then follows immediately, between single quote marks. is as follows: The pattern, then, for a simple replacement command Column 1 ' (the search string) ' = ' (the replace string) ' Serialization goes in columns 73-80 of the control card, if it appears at all; editing commands never go into columns 73-80. XV-8 The maximum length of the search string, excluding the boundary quote marks, is 72 characters. The maximum length of the replace string, Strings of also excluding the boundary quote marks, is 144 characters. length zero are not allowed. A discussion of the legitimate contents of character strings in EDIT can be found below. Editing commands often must be extended from one control card to the next, when the search and replace strings are of greater than moderate length. This extension is accomplished by continuing the command from column 72 of one control card to column 1 of the next control card, with no intervening characters other than serialization, if present, on the first control card of a command. The serialization columns are ignored If a command must be spread over on cards used for extending commands. more than two control cards, only columns 1-72 of succeeding cards are used; the serialization columns are always ignored. When EDIT control cards are listed at the end of the run, all cards of extended commands will be preceded by a + (plus sign), except for the last card of an extended command, which will appear with no marking character. Because no identifying marks are used to signify control card extensions, and because the convention for expressing quote marks within a character string is "doubling", (see below), if a terminal quote mark for an editing command appears in column 72 of a control card, the next card must be blank. The reason for this is that EDIT will scan the first column of the next control card if column 72 contains a quote mark, because EDIT cannot know beforehand if the quote mark is the terminal symbol for a character string of the first of a pair of doubled quote marks. XV-9 Certain character strings may occur very frequently in a given body of text, and it may be desired to alter such strings every time they occur. In order to do this without repeating the replacement command many times, a replacement command may be entered in a table of commands to be executed wherever possible in the body of text. These "permanent replacement commands" are performed on every card that is read into EDIT, but card boundaries are ignored in scanning for their search strings. The format for a permanent replacement card (or "P" card) is, beginning in column 1, as follows: P' (search string) ' = ' (replace string)1 Once again, serialization goes in columns 73-80. Just as for a temporary replacement card, the maximum lengths for search and replace strings are 72 and 144 characters, respectively, and strings of length zero are not allowed. Again, if additional cards are needed to accomodate a replacement command, the strings and terminal symbols are merely extended from column 72 of one control card to column 1 of the next. And here, as before, if a terminal quote mark appears in column 72 of a control card, the following card must be blank to signify the end of the command. P cards are executed from the time of their first definition until they are erased from the table of permanent editing commands. (See below for "E" cards, which erase P cards, as well as permanent deletion cards and keyword cards. These are "X" and "K" cards.) XV-10 P cards may be serialized, therefore, and the particular replacement will not be initiated until the text card with matching serialization is encountered. Care should be exercised in defining permanent replacement commands, as a card of text may be subjected to two or three scans using the same set of P (and X) cards. That is, if for example, it is desired to double all periods that are standing alone, the following command ought not to be used: p» XT « i—i —* i « « On a piece of text such as the following, the results would presumably not be the desired ones: 'A . B . C . ARE THE CALL LETTERS OF A TV NETWORK . ' The results could conceivably be: »A . . . . B .... C .... ARE THE CALL LETTERS OF A TV NETWORK ' This would result from two passes over the text, caused by the need to accumulate several lines of text for scanning to allow for the occurrence of search strings across card boundaries. The proper definition of a P card for doubling of the standing-alone periods would be: pi I^I i Blanks are, of course, significant within quote marks. As EDIT is presently assembled, up to 20 P cards may be defined at once. However, the total number of characters in all the search XV-11 strings of all the replacement commands may not exceed 200. Also, the total number of characters in all the replace strings of all the replacement commands may not exceed 300. All permanent editing commands (P and X cards) are performed at the same time, in the order of their definition. This allows intermingling of P and X cards. In order to delete characters from input text, a card is used with the following format, beginning in column 1: D" (delete string) f Again, serialization is in columns 73-80, if it appears at all. maximum length of the delete string is 72 characters, excluding The boundary quote marks, just as is the search string for temporary and permanent replacement cards. (This is assembled into EDIT, and the same assembly language specification is used to define the maximum length for search and delete strings.) zero are not allowed. Delete strings of length The convention for extending temporary deletion cards, or "D" cards, is the same as that for extending temporary replacement cards, and as before, if the terminal quote mark for a delete string appears in column 72, the succeeding control card must be blank to signify the end of the command. If an entire card (or group of cards) is to be removed at once, the chore of writing it entirely out within quotes can be avoided by using a D card of the following format, starting in column 1: D*k Note that k is the number of entire cards to be deleted, and is written, with no intervening or embedded blanks, as an integer. There is no XV-12 limit to the size of this number; but if any character other than o, 1,..., 9 appears before the terminal blank for the command, only 1 card will be deleted. avoided. This command (D*k) is unique in that a text card is read in immediately after the command is carried out, and before the next control card is read in. This contradicts the normal sequence of input for control and text cards as outlined in section 3 A). The result can be an eof return (See The command D*0 will produce irrational results and should be to BATMAN if the last card in a file is removed by a D*k command. section 3, Part C). As with replacement commands, there may be sequences of characters that must be deleted from many different places in a body of text. D cards may be made applicable to all text cards by writing them as permanent deletion cards, or "X" cards. The format of X cards is identical to that of D cards, except, of course, that X replaces D in column 1: X1 (.delete string) ' X cards, mingled with P cards, are executed from the time of their first definition until they are erased from the table of permanent editing commands. They may also be serialized, and will not be enacted until the P and X cards are performed in the order of proper text card is reached. their definition. A maximum of 20 X cards may be defined at once, and the total number of characters in all delete strings may not exceed 200. The command X*k, which is analogous to D*k, is not allowed. XV-13 C) Special Commands As mentioned before, the input stream of characters may contain, at the beginning of card images, certain strings which should begin card images on output. As EDIT is assembled, two of these "keywords" are in "*" and "$", if found at the beginning the table of keywords already. of a card on input to EDIT, will cause EDIT to unbuffer itself and place that card at the beginning of the next segment of output. Up to 18 additional keywords may be defined, by using "K" cards of either of the following formats: K' (keyword string) ' K' (keyword string) '* The effect of this card is to cause any input card beginning with, the character string bounded by quote marks to be forced to the beginning of a card image on output. If the keyword has been specified without a star after the terminal quote mark for the keyword string, the entire text card that begins with the keyword will be treated as though the Q switch (see below) were temporarily OFF; that is, any blanks on it will not be squeezed together. This preserves the integrity of title If, however, the keyword and author cards under the SMART system. has been defined with a star following the terminal quote mark of the keyword string, only the keyword itself is protected against squeezing. This allows paragraphs, beginning with, let us say, two blanks, to be preserved as paragraphs while allowing text squeezing to go on as usual. XV-14 The two leading blanks would not be squeezed out of existence in this case, but all other blanks on text cards would be treated in accordance with the setting of the Q switch. characters. The Q switch has been mentioned several times. Its setting The current maximum length for keywords is 6 determines whether or not consecutive blanks are to be squeezed to single blanks. The switch can be turned on with a control card with the following in columns 1-6: Q'ON'b Columns 7-72 are ignored when a Q is encountered in column 1 of an EDIT control card; as usual, columns 73-80 may contain serialization. To turn the Q switch off, a Q card should contain the following in columns 1-6: Q'OFF' If the contents of columns 2-6 are not either of the above strings, the Q switch is inverted. That is, if it is off, then it is turned on, and if it is on, then it is turned off. The setting of the Q switch overrides the partial blank-squeezing Specifiable with K cards. If a K card with a star is defined, and the Q switch is off, no blanks will be squeezed from any input card beginning with the specified keyword. Regardless of the setting of the Q switch, words are never broken by EDIT across card boundaries on output. XV-15 The relationship between the Q switch setting and P and X cards merits some discussion. If the Q switch is 'ON1, squeezing of blanks takes place just before each permanent editing command is carried out. This means that search strings which contain any occurrences of multiple blanks will never be found while Q is f0N' , except in two circumstances: a) when a search string occurs on a text card that is protected from squeezing by a keyword, and b) when a search string is found that is the result of a successful permanent replacement earlier in the list of permanent editing commands. The H switch determines whether or not EDIT will scan input cards for words hyphenated across card boundaries. The H switch- can be turned on or off with control cards of the following type: H'ON'b H'OFF' Columns 7-72 are ignored when an H is found in column 1 of a control card; columns 73-80 may contain serialization numbers. As with the Q switch, if the contents of columns 1-6 are not either of the above patterns, the H switch is inverted. The H switch is overridden by the Q switch, and thus, words may not be reintegrated if the Q switch is not 'ON' . XV-16 If the H switch and the Q switch are both 'ON1, EDIT first scans the last non-blank character of each input card, while the next card of input text is being read in. Hyphen-checking therefore lags the rest of the editing process by one card image. If the last non-blank character of the last card read in is not a hyphen (11-punch or minus sign, not the 4-8 punch as in some character sets) the checking stops. If this last character is hyphen, the first character on the next card is checked. If the first character is any of the digits 0-9, reintegration If the first character does not take place (the hyphen is not deleted\. is anything but a digit, the hyphen from the preceding card and all intervening blanks are deleted. Because of this treatment while rein- tegrating hyphenated words, words that are broken at an embedded hyphen must be broken with two consecutive hyphens. One of these is deleted if the word is ever reintegrated, and the other remains as the original hyphen and part of the word. EDIT may be made to run without interruption until the eof marker for the input text is reached, by including a control card witH the letter "F" in column 1. P, X, and K cards are checked, if any are defined, and squeezing and word reintegration are performed according to the Q and H switch settings. All this is automatic, and no control cards are read again until after control has reverted to BATMAN after the eof marker has been encountered. For that reason, the next control card after any F card should be a BATMAN control card; an "R" card, which returns control to BATMAN in other situations, is redundant and in error. CSee belowl. XV-17 EDIT may also be made to produce a log of its activities when the eof marker has been reached. The following control card does the automatic work until the eof marker is reached, and then a log is printed before control is returned to BATMAN: F'LOG' If columns 2-6 of an F card contain anything but 'LOG', the log is not produced before the eof return to BATMAN is taken. are ignored; columns 73-80 may contain serialization. The log mentioned above may be produced at any time while EDIT has control, by using a control card with the letter "L" in column 1. Columns 2-72 are ignored, and the control card may be serialized in columns 73-80. for. The log contains the following information: EDIT does not unbuffer itself when a log is called Columns 7-72 a) A 12-digit octal integer representing the contents of the 7094fs sense indicators. is appended .) (A directory to the SI b) c) d) The current settings of the Q and H switches. The number of currently active P, X, and K cards. A listing of all currently active P and X cards, in order of their definition, which is also the order of their execution. The number of times each has occurred since the last log was written is listed. e) A listing of all currently active K cards, in order of their definition and execution, with a listing of the number of times each has occurred since the last log was written. XV-18 f) The number of temporary replacement cards that have been attempted since the last log, with the number and percent that have failed. (A failure is defined as no occurrences of the search string in the scanned line). g) The number of D cards since the last log, with the number and percent that have failed. (Similarly, a failure here is defined as no occurrences of the delete string in the scanned line.! Note that the counters involved in the production of a log are zeroed only after a log is produced. The counters are not zeroed when control is passed back and forth between BATMAN and EDIT. All of EDIT's currently active P, X, and K cards are kept in tables. These tables are preserved, intact, whether or not EDIT retains control, unless they are deliberately erased tor some catastrophe befalls the job). This task of erasing the tables is accomplished by a control card with the format shown below, beginning in column 1: E' (erase string). ' The "erase string" is made up of any combination of the following characters: P, X, K, *, or $. Any other character, including blank, is Each character in the erase string specified illegal for an erase string. a portion of a table to be erased; repetition of a character has no effect. Any character other than these will cause erasing to cease and an error message to be printed. quote mark. Erasure of the tables is normally ended by a single Columns 73-80 may be used for serialization, as usual, and all unused columns are ignored. XV P and X cards are kept intermingled within EDIT, but a P in the erasing specifications will erase all of the P cards and leave the X cards intact; similarly, an X will erase only the X cards. A "garbage-collecting" segment of code eliminates the holes in the table of P and X cards after either P or X cards are erased. After each set of erasures, any P or X card that is 'subsequently defined will be placed at the end of the list of P and X cards to be checked. If a permanent editing command has previously been defined and erased, a new definition of the same editing command is treated as though it has never been seen before. The character K within the erase string causes the erasure of all user-defined K cards. The assembled-in keywords "*" and "$", which appear in that order at the head of the keyword table, are not affected by such an erasure. "*" and "$" can be erased, however, if If they are these same characters appear in an erasing command. erased, they lose their position of priority at the beginning of the list of keywords, even if they are redefined at a later time. Control may be returned to BATMAN at any time with a control card containing the character "R" in column 1. Columns 2-6 may contain the characters 'LOG1, in which case a log from EDIT is produced before control reverts to BATMAN. No log is produced if columns 2-6 contain other characters; in this case, the contents of these columns are ignored. Columns 7-72 are always ignored, and columns EDIT unbuffers itself 73-80 may, of course, contain serialization. when control is passed to BATMAN, but none of its counters are zeroed and all switch settings remain intact. are saved and restored by EDIT itself). (That is, the sense indicators XV-20 4. Editing Principles A) Temporary Cards (",M and D Cards) Temporary replacement and deletion cards specify commands that are effective for only one card of input text. are not crossed. Nothing whatsoever is done to the card before the temporary scans are carried out. This means that consecutive blanks have not yet been Input text card boundaries squeezed, nor has any word reintegration taken place, regardless of the settings of the Q and H switches. Each occurrence of a search or delete string is replaced or deleted, no matter how many replacements or deletions this may imply. Thus, if the following control command is performed on the text card which succeeds it... D'A1 (performed on) 'ENGLAND IS A FARAWAY COUNTRY.1 ... the result is: f ENGLND IS FRWY COUNTRY.1 Note that all occurrences of 'A1 have been deleted, and that no squeezing of blanks has occurred. The card of text is scanned only once under a temporary editing command. Blanks inserted in text as part of replace strings are tagged within EDIT and are never squeezed into each other or blanks which are original input text. XV-21 B) Permanent Commands (P and X Cards) Permanent replacement and deletion cards are effective for all cards of input text, including keyword-headed cards; card boundaries are ignored. All temporary scans and the blank-squeezing and wordreintegration processes take place before any P or X cards are executed, for each card of input text. In fact, the P and X scans are the last things that text cards are subjected to before being outputted. Obviously, all occurrences of search strings are replaced or deleted as the command specifies. Because of the need to keep some text in EDIT to match strings across card boundaries, multiple scanning may occur as a result, and any single card may be scanned two or more times under the same P or X command. (See section 3, Part B) Since P and X commands are the last things performed on a line of output text before the line is outputted, even when an eof marker is encountered, they cannot ordinarily be skipped. However, if control is returned to BATMAN by means of an R card, control is immediately transferred, without any checking of P and X commands. EDIT unbuffers itself when returning control to BATMAN, so the following sequence of control cards would cause text card number 00230040 to be copied without any P or X commands performed on it: XV-22 Column 1 RETURN TO BATMAN ENTER EDIT AGAIN command in EDIT... Column 73 00230040 As before, blanks which appear in replace strings are never squeezed, either with each other or with blanks that have never been touched by EDIT. C) String Contents Search, replace, delete, and keyword strings, as well as all input text, may contain any of the 64 characters capable of being represented internally on the 7094, with two exceptions and one caution. codes 0-6-8 and 0-7-8 Card punch (internally, octal 76 and 77 respectively) may not Card punch code 11-7-8 be used, as EDIT uses them for internal markers. (octal 57) forces the character immediately following it to appear in column 1 of the next output card image; any unfilled spaces in the preceding card image are filled with blanks. The 11-7-8 character disappears. 5. Miscellany and Tables EDIT is initially set up so that all tables are empty and all internal switches (bits 0-22 and 32-35 of the sense indicators) are off, with the following exceptions: a) The Q switch, which is internally bit 2 of the SI, is initially on (or 'ON'); b) The keyword table has the entries for '*' and f $ ' in the first and second available spaces, respectively. XV As EDIT is presently assembled, it occupies 13166 (octal) locations in the 7094. When BATMAN-EDIT is run, complete with its own small package of I/O routines, the needed library routines from the FMS library, and a clock-reading subroutine, it occupies low core up to location 51201 and high core from location 77507 on. The space between these locations is used by BATMAN to accumulate control cards for the final control card listing; if the available space is used up, accumultation of control cards ends and a message is written at the end of the run. are, of course, listed. Timing properties for EDIT are difficult to estimate. a rough rule of thumb is as follows: However, All the control cards that were accumulated if the number of keywords is small (under 5 ) , if Q is 'ON1 and H is 'OFF', if the density of temporary editing commands is high (around 1 correction per card of input text), and if output is to be simultaneously printed on the system output tape, then about .01 minutes are required per 100 cards of input text, per permanent editing specification. That is, for most of the Project SMART editing done with BATMAN-EDIT, the following timing formulay has been derived empirically: .01 min/100 cards/P or X command. Of course, the fact that the "real" output is blocked and the copy of the output on the system print tape is unblocked lends further mystery to the problem of exactly timing BATMAN-EDIT runs, but the above is the best available estimate. When the listing of control cards is produced at the end of a BATMAN-EDIT run, EDIT control cards may be preceded by any or none XV-2 4 of three characters. They are: *, + , and the letter 0. The star, *, signifies that for some reason the specified command was not carried out properly; usually an error message can be found somewhere in the run to explain why the command was starred. The plus sign, + , signifies a command that has been extended from one control card to another (see section 3, Part 2). It does not appear as a prefix to the last control card of the command; the last card of a command may, however, be preceded by a star or an £. EDIT does not allow a card image on input to be expanded to more than about 5-1/2 times its size; when a control card specifies a replacement that will overflow the available work space, EDIT makes room for the replacement by getting rid of one card image from the head of the work space. An error message is printed, and the character < will appear before the relevant control card in D the control card listing. XV-2 5 Column 1 1 73 (search string) '= (replace string) f 00000000 11111111 bbbl5670 00230086 P'(search string) f = D (delete string) ' D*k X' (delete string). f 1 (replace string) ' bbbbbbbb BACDEHGJ 12345678 bbbbbbbb 98765432 24682468 AAAABBBB QUINONES K* (keyword string) ' K 1 (keyword string) ' * Q'ON'b Q'OFF' H' ON' b H'OFF' F F ' LOG L E' (erase string). ' R R'LOG' f 00310056 00000000 06661234 80808080 )))$$$$$ Note: Anything between quotes is allowed. Anything is allowed in the serialization columns, as long as a match can be found in the input text. Columns not explicitly required to be blanks (b) are ignored. EDIT Control Card Formats Table 1 XV-2 6 Search string Replace string Delete string Keyword string Erase string - 72 characters 144 characters 72 characters 6 characters any number of characters, but none besides: P, X, K, *, $. a) Maximum String Lengths p cards - 20 separate commands (total of search strings may not exceed 200 characters, total of replace strings may not exceed 300 characters) 20 separate commands (total of delete strings may not exceed 200 characters) 20 separate commands, including the assembled-in 1 *• and f $' (total of keyword strings may not exceed 120 characters) X cards K cards - b) Table Sizes Maximum String Lengths and Table Sizes Table 2 XV-2 7 The following is a directory to the use of the left half of the sense indicators as used in EDIT 400000 200000 100000 040000 020000 010000 004000 002000 001000 000400 000200 1Q1Q1010101010101010- the .Last replacement card was a 'P' card. the .Last replacement card was a string card. the Last deletion card was a 'X1 card. the .Last deletion card was a 'D' card. cards will be squeezed of blanks. cards will not be squeezed. last control card had non-blank serialization last control card had blank serialization. last temporary scan was a replacement. last temporary scan was a deletion. text card serialization matches control card serial. text card serial does not match control card serial. last card written had 'bad input1 flag. Last card written had no flag. last card written had 'bad input' flag. last card read had no flag. not used, not used. there are permanent insertions or deletions or both, there are no permanent insertions or deletions. unbuffering before a 'D*k' card where Q is off, has not yet occurred. unbuffering in the above case has taken place* 0001Q0 000040 1010- no squeezing of blanks on the present card, if Q is on, squeezing will occur. a previously defined BATMAN serialization (textsr or incser) will be used on output, an EDIT-defined incser replaces a BATMAN noser or copser. EDIT uses the number on the first text card read as a base, and increments by 10. the last card put out used all 72 columns, the last card put out did not use 72 columns. the last 'K' card was of the form (K'XXX'*). the last 'K' card was of the form (K'XXX' ) . the current card has a key word. Do not squeeze it, but squeeze the rest of the card if Q is on. the current card has no key word. Q determines squeezing of blanks on the card. undo hyphenations, retain hypenations. final 'F' card requested a permanent command log. final 'F' card merely ended the file. 000020 000010 000004 1 0 1 0 1 0 000002 000001 1 0 1 0 Directory to the Sense Indicators Table 3 XV-2 8 This is a directory to the use of the right half of the sense indicators in EDIT. 400000 1010- last temporary card succeeded. last temporary card failed. not used. not used. last P or X card in last log was X. last P or X card in last log was P. used for 'ho. of occurrences1 in logs. •. EDIT is inputting text cards. EDIT has not required text cards yet. 200000 100000 040000 020000 010000 1 004000 002000 001000 000400 000200 000100 000040 000020 10- i 0l0l01010101010101010- The rightmost four bits of the SI contain a code number for the last control card read in. The directory follows. 000001 regular replacement card (quote card] 000002 P card 000003 D card (also D*K cards) 000004 X card K card 000005 000006 E card 000007 Q card 000010 H card 000011 F card (also f 'LOG1 cards) 000012 not used. 000013 not used. 000014 R card 000015- D00017 are not yet used. Table 3 (continued)