J3/05-255r1 Date: 2005 August 12 To: J3 From: Dan Nagle Subject: Modifying G format for CSV This paper is 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. 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 indefinite very large repeat count. 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 * repeat count in formats. Edits [222:14+] Add <> * [222:15] Change " shall be positive" to "If is an , it shall be positive" [222:17] Delete "The integer literal constant" [223:9] Change "Gw.d[Ee]" to "Gw[.d[Ee]]" [223:20] Change "Z," to "Z, G," [223:24+] Add "C10?? (R1005) For the G edit descriptor, if is zero, shall not be specified. C10?? (R1005) For the G edit descriptor, if is not zero, shall be specified." [224:33] Change "repeat specification" to " repeat specification" [224:34+] Add "If the repeat specification is *, the effect is as if an infinitely large repeat count was specified." [224:34+] Add a Note 10.4+ "A repeat specification of * should only be used with format items which consume list items. Any format items after a format item with a repeat specification of * cannot be processed." [227:13] After "Z," insert "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 ." [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."