From: Eric S. Raymond Date: Tue, 17 Feb 2004 21:11:44 +0000 (+0000) Subject: More pages input X-Git-Tag: 1.0~99 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=56237a07d53d4b4c6c38111f9b889fd1f2ce85af;p=mad.git More pages input --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index a5413f7..4111664 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -2387,7 +2387,229 @@ according to the specification E18.4*, but it would print as 93.2100E-05 according to the specification 2PE18.4*. Unlike an F number, the value is the same in either case. + + +Multiple Specifications + +Several specifications may be condensed into one larger one by the use +of the character "/". Each appearance of "/" (except as part of a +Hollerith field-see section 2.15.8) indicates that the specification +of a new line (or card) is to be started with what follows. A pair +"//" causes a blank line (or card), three "///" cause two blank lines +(or cards), etc. Thus, the specification + + +3F10.3/I2, K18, 2C5/7I3* + + +implies that one line (or card) is described by the specification +3F10.3, and the next line (or card) is described by the specification +I2,K18,2C5, and the next by 7I3. It must be noted that each line (if +printing is being described) is described individually here, and must + include its own carriage control (see section +2.15.1). + + +Hollerith fields + +Although the C specification is available for transmitting +characters (Hollerith information) to and from storage, it is often +convenient to include strings of Hollerith characters directly in the +format specification. This is done by means of a basic Hollerith +field specification consisting of the string of characters to be +transmittted, preceded by a count of these characters and the letter +"H". Thus, if the specification + + +1H1 F10.3, 6HBETA = E10.2 + + +were used in printing one would obtain a new page skip, because of the +one column Hollerith field containing the character "1". Then a ten +column F number would print, followed by the characters "BETA =" and a +floating point ten column field. Note that blanks are completely +ignored throughout all format specifications except when they occur as +characters in a Hollerith string. Note also, that while every field +specification of types S, I, E, F, K, and C must be followed by +commas, the comma may be omitted after a Hollerith string of the type +described here. The comma may be used, however, if desired. + + +Character fields + +It has been stated above that a number +appearing in an oversize field is pushed as far as possible to the + right. In the case of C information +(characters), any information occurring in an oversize field is pushed +to the left , while in either case, unused +columns of the field are filled with blanks. Similarly, in the case +the specification describes too small a field, characters are taken +from the left end of the field until the field +is exhausted. + +Thus, if a card contins the characters: ABCDEFGHIJK in column 1 +through 11, and it is read according to the specification 2C3*, the +two six character words that are read into the computer are: + + + ABC□□□ + DEF□□□ + + +(where "□" denotes "blank"), while the specification C6* would +cause a single word to be read: + + +ABCDEF + + +and C7, C3* would cause the words: + + +ABCDEF and HIJ□□□ + + +to be read (since at most six characters can go into one word of +storage). + +Relationship between the List and the Specification + +The "list" consists of a set of names of variables to or from which +information is to flow. Except for Hollerith strings imbedded in the +format specification itself (see section 2.15.8) and the S fields, +each field in the specification refers to one item on the list. For +this purpose, a regional entry on the list, such as A(6) ...A(8), +counts as several names of variables (in this case, the three +variables A(6), A(7), and A(8).) During the transmission of +information, the input or output subroutine scans both the list and +the specification simultaneously, correlating corresponding entries, +and associating a field size, a type of conversion, etc. to each +variable. If a Hollerith string is encountered in the specification, +it is immediately transmitted, and it is not associated with any item +on the "list." + +For example, if the list consisted of: + +A, B(1,1), I, K, where I and K were integers, and the others floating +point, and the specification was + + +1H1, F11.3, -2PE14.4, S13, 3HM =I3, S9, 3HJ =I3* + + +we might find a printed line something like the following (at the top of the next page because of the 1H1): + + +456.010 -16.1251E+02 M = 50 J = 17 + + +The same list would look the following way with the +specification 1H1, 2F11.3, S16, 3HM =I3, S9, 3HJ = 13*: + + +456.101 -1612.510 M = 50 J = 17 + + +As stated above, a specification may not account for more than 72 +columns on a card. It may happen, however, that a list calls for more +information than can appear on a single card. Or perhaps only a +certain part of each card is to be read. The determining factor in +every case is whether or not the entire list has been accounted for. +After each cards is read according to the format specification, the +list is consulted; if not yet satisfied, another card is read, and so +on. It is important to realize that the specification is not +necessarily scanned from the beginning when a new card is read. In +fact, the specification scanner moves to the left from the end of the +specification (the *) until it hits a left parenthesis not in an H +field. (If there is no left parenthesis, it will move to the +beginning of the specification). It then examines the characters just +to the left of this left parenthesis to see if they are a multiplicity +indication (see section 2.15.5). From this left parenthesis (together +with the multiplicity, if any) to the end of the specification now +becomes the format specification until the list is satisfied. A +similar statement may be made for printed or punched output. + +Thus, in the specification: + + +3F10.3 /4(F10.3, 6HBETA = I2)* + + +the first line printed (or read) would have three fixed point numbers, +subsequent lines would all be printed (or read) according to the +specification + + +4(F10.3, 6HBETA =I2)* + + +As an example, one might have an integer on a first data card, +followed by many cards, each with six floating point numbers. The +specification might then be: + + +I6/(6E10.5)* + + +Only the first six columns would be read on the first cards, and only +60 columns would be read on subsequent cards. The remaining columns +are ignored and may contain any legitimate +Hollerith characters. + +If a specification contains a Hollerith string of the form +nHa_1a_2...a_n, certain conventions are observed. (1) If the list is +satisifed, but the next field specification is a Hollerith string, the +string is transmitted, anyway. (2) On input, i.e., reading from +cards, when a Hollerith string is encountered in the specification, +the information in the corresponding columns of the input card will be +brought in and will replace the BCD string itself within the format +specification. This can then be used as a specification for output, +for example. This is useful for labelling a set of data and causing +the label to appear on the output along with a date, etc. + +Thus, a card punched as follows: + + +1 DATA SET NO. 3-A JULY 31, 1959 J. DOE + + +might be read in with a format specification + + +72H (72 blank spaces) *. + + +Later, this specification could be used to print the same information +as a heading for the results. Note the "1" provided for carriage +control for the printing. + +WARNING: The specifications S72* and 72(1H )*, while indicating 72 +blank spaces, do not allow the reading in of an entire card, as +indicated above, since they do not really provide a storage region of +72 characters in length into which the information on the card may be +read and stored until needed. + + + + +Declarations (Non-executable statements) + +Declarations are non-executable statements, and, except for function +declarations, they may occur anywhere in the program. Their purpose +is to furnish information to the translator program or to the reader +of the program. Declarations may have statement labels, but these +labels are ignored by the translator, and may not be referred to in +other statements. + +Remark Declaration + +A remark declaration consists of any string of characters +acceptable to the computer. This statement is completely ignored by +the translator, and furnishes information to the reader of the +program. Every card of the remark declaration must have an "R" in +column 11. +