J3/05-275r3 To: J3 From: Dan Nagle Subject: g0 & * Date: 2005 November 10 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 * as 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 effective list items. Syntax: Allow G0 edit descriptor in formats. Allow * to suppress new records when format reversion occurs. Edits [221:15+] Add a new production to R1002 "<> ( [ , ] )" Make a new rule [222:13+] Add "R1004a <> *()" Modify the text [223:9] Change "G . [ E ]" to "G [ . [ E ] ]" [223:20] Change "and F" to "F, and G" [223: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 the beginning of an , 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.6a The effect of an is as if its enclosed list were preceded by a very large repeat count. There is no file positioning implied by reversion. 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 "G. and G. E" to "G, G., and G. E" [233:21] Change "These" to "When is nonzero, these" [233:23] Append: "When is zero the processor selects the field width. On input, shall not be zero." [233:25] Change "G. and G. E" to "G, G., and G. E" [233:29] Append "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 a new paragraph "When used to specify the output of real or complex data, the G0 edit descriptor follows the rules for the ES. E edit descriptor. Reasonable processor-dependent values of , , and are used with each output value." [234:1] After "output field" insert "for the G. and G. E edit descriptors" [234:15] Append "When used to specify the output of logical data, the G0 edit descriptor follows the rules for the L1 edit descriptor." [234:18] Append "When used to specify the output of character data, the G0 edit descriptor follows the rules for the A edit descriptor with no field width."