J3/15-112r3 To: J3 From: Dan Nagle & Malcolm Cohen Subject: UTI 011 Date: 2015 February 25 Reference: 15-011 1. Introduction UTI 011 points out that GET_ENVIRONMENT_VARIABLE is missing an example. This is also true of GET_COMMAND and EXECUTE_COMMENT_LINE. Several of the existing examples are missing any text explaining what it is they are meant to be doing. 2. Edits to 15-007 [347:34-36] Unparagraph the example and indent 7 spaces. [347:37-39] Unparagraph the explanation. [and then] Move 37-39 to precede 34-36. {This should just be part of the Example paragraph. I prefer to have the explanation precede the code.} [353:end] 13.7.61 EXTENDS_TYPE_OF, right at the end, insert Example para "<> Given the declarations and assignments TYPE T1 REAL C END TYPE TYPE, EXTENDS(T1) :: T2 END TYPE CLASS(T1), POINTER :: P, Q ALLOCATE (P) ALLOCATE (T2 :: Q) the result of EXTENDS_TYPE_OF (P, Q) will be false, and the result of EXTENDS_TYPE_OF (Q, P) will be true.". {Add missing example.} [356:17+] 13.7.66 GET_COMMAND, p3+, insert Example paragraph "<> If the program below is invoked with the command "example", it will display "Hello example". PROGRAM hello CHARACTER(:), ALLOCATABLE :: cmd INTEGER :: cmdlen CALL GET_COMMAND(LENGTH=cmdlen) IF (cmdlen>0) THEN ALLOCATE(CHARACTER(cmdlen) :: cmd) CALL GET_COMMAND(cmd) PRINT *, 'Hello ', cmd END IF END PROGRAM". {Add simple example for GET_COMMAND.} [356:43] 13.7.67 GET_COMMAND_ARGUMENT, p4 Example, insert first sentence "The following program displays the arguments of the command by which it was invoked." {Say what the example is.} [356:44] Change "echo" to "show_arguments". {This is not very much like the "echo" command!} [357:35+] 13.7.68 GET_ENVIRONMENT_VARIABLE, p4+, insert Example paragraph "<> If the value of the environment variable DATAFILE is datafile.dat, executing the statement sequence below will assign the value 'datafile.dat' to FILENAME. CHARACTER(:),ALLOCATABLE :: FILENAME INTEGER :: NAMELEN CALL GET_ENVIRONMENT_VARIABLE ("DATAFILE", & LENGTH=NAMELEN) IF (LENGTH>0) THEN ALLOCATE(CHARACTER(LENGTH) :: FILENAME) CALL GET_ENVIRONMENT_VARIABLE("DATAFILE", FILENAME) END IF". {Add example.} [357:35+1-3] Delete UTI 011 if it has been resolved. [378:38] 13.7.119 MOVE_ALLOC, p8 Example, insert first sentence "The example below demonstrates reallocation of GRID to twice its previous size, with its previous contents evenly distributed over the new elements so that intermediate points can be inserted." {Say what this is supposed to be showing.} [379:1-11] Unparagraph the example, check indentation (7 spaces), delete the "reallocation" comment, turn the last set of comments into normal text within the same paragraph, inserting "The" before "old", removing the scare quotes around "takes over" and inserting the definite article before "new". {Make this look less ugly.} [379:30] 13.7.120 MVBITS, p4 Example, If the statement won't fit on the same line as the opening part of the sentence, indent it 7 spaces and put "is 5" on the next line; all within the same paragraph. {Looks weird as is.} [380:16+] 13.7.122 NEW_LINE, p5+, insert Example paragraph "<> If there is a suitable newline character, and unit 10 is connected for formatted stream output, the statement WRITE (10, '(A)') 'New'//NEW_LINE('a')//'Line' will write a record containing ``New'' and then a record containing ``Line''.". {Add an example for NEW_LINE.} [382:27] 13.7.127 NUM_IMAGES, p6 Example, Unparagraph the example code (and check indentation). [392:2-] 13.7.147 SAME_TYPE_AS, right at the end, insert Example para "<> Given the declarations and assignments TYPE T1 REAL C END TYPE TYPE, EXTENDS(T1) :: T2 END TYPE CLASS(T1), POINTER :: P, Q, R ALLOCATE(P, Q) ALLOCATE(T2 :: R) the result of SAME_TYPE_AS (P, Q) will be true, and SAME_TYPE_AS (P, R) will be false.". {Add example.} [393:17] 13.7.150 SELECTED_CHAR_KIND, p6 Examples, Unparagraph the code. ===END===