J3/05-275r1 To: J3 From: Dan Nagle Subject: g0 & * Date: 2005 November 7 This paper furthers the ideas of 05-255r1, which was a substitute design for 05-249 and 05-253, it is an attempt to further item J3-048. This paper advances Van's G format descriptor modifications to make G format enable easy writing of CSV files. It adds Dick's idea for * as the infinite repeat count specifier. Malcolm added some critical thoughts to this design. Specification: With a G edit descriptor, allow a w=0 to specify minimum-width output format. The w=0 is not allowed for input. If w=0, d and Ee shall not be present. If the corresponding list item is of type character, the effect of the G0 is the same as an A edit descriptor with no width specified. If the corresponding list item is of type logical, the effect of the G0 is the same as an L1 edit descriptor. If the corresponding list item is of type integer, the effect of the G0 is the same as an I0 edit descriptor. If the corresponding list item is of type real, the effect of the G0 is the same as an ESw.dEe edit descriptor, where the processor will use reasonable values of w, d and e so there will be no leading or trailing spaces. Allow * a sub-format prefix specifying that format reversion does not start a new record. Example: (*(g0,:,',')) writes a "CSV" line, given any number of any intrinsic type & kind of list items. Syntax: Allow G0 edit descriptor in formats. Allow * to suppress new records when format reversion occurs. Edits Modify R1004 [222:13+] Add "<> " Make a new rule [222:13+] Add "R1004+ is *()" [222:16+] Add new constraints "C1004+ (R1002) An shall appear only as the last item in a . C1004++ (R1003) An shall not appear within an []()." Modify the text [223:9] Change "G w . d [ E e ]" to "G w [ . d [ E e ] ]" [223:20] Change "and F" to "F, and G" [224:21+] Add a new constraint "C1006a (R1005) For the G edit descriptor, shall be specified if and only if is not zero." Modify the reversion discussion [225:13-15] Delete the sentence "However, if another ... processed (10.7.2)." [225:15] Change "Format control then" to "Otherwise, format control" [225:20] Add a new sentence after "... specification is reused." "If format control reverts to a parenthesis that is not part of an , then the file is positioned in a manner identical to the way it is positioned when a slash edit descriptor is processed (10.7.2)." Add a Note after Note 10.6 Add "Note 10.6+ The effect of an list was preceded by a very large repeat count. There is no slash processing when an reverts. This may be used to write what is commonly called a comma separated value record. For example, WRITE( 10, '( "IARRAY =", *( I0, :, ","))') IARRAY produces a single record with a header and a comma separated list of integer values." [227:13] Change "and F" to "F, and G" [233:20] Change "Gw.d and Gw.dEe" to "Gw, Gw.d, and Gw.dEe" [233:21] Change "These" to "When is nonzero, these" [233:23] Add: "When is zero, and E shall not be appear, and the processor selects the field width. When does not appear, shall be zero. On input, shall not be zero." [233:25] Change "Gw.d and Gw.dEe" to "Gw, Gw.d, and Gw.dEe" [233:29] Add "When used to specify the output of integer data, the G0 edit descriptor follows the rules for the I0 edit descriptor." [234:1-] At the top of the page, add "When used to specify the output of real and complex data, the G0 edit descriptor follows the rules for the ESw.dEe edit descriptor, for reasonable processor-dependent values of , , and for each output value." [234:15] Add "When used to specify the output logical data, the G0 edit descriptor follows the rules for the L1 edit descriptor." [234:18] Add "When used to specify the output character data, the G0 edit descriptor follows the rules for the A edit descriptor with no field width."