Report Generation
Summary Line Report
Composing Text
A report line can combine labels and numeric summaries before it is printed.
Program
Play the program to change the item count and rebuild the summary line.
summary_line_report.f90
program summary_line_report_demo
implicit none
integer :: item_count
integer :: passed_count
character(len=40) :: line
item_count =
passed_count = item_count - 1
write(line, '(A, I0, A, I0)') 'passed ', passed_count, ' of ', item_count
print '(A)', trim(line)
end program summary_line_report_demo
program summary_line_report_demo
implicit none
integer :: item_count
integer :: passed_count
character(len=40) :: line
item_count =
passed_count = item_count - 1
write(line, '(A, I0, A, I0)') 'passed ', passed_count, ' of ', item_count
print '(A)', trim(line)
end program summary_line_report_demo
program summary_line_report_demo
implicit none
integer :: item_count
integer :: passed_count
character(len=40) :: line
item_count =
passed_count = item_count - 1
write(line, '(A, I0, A, I0)') 'passed ', passed_count, ' of ', item_count
print '(A)', trim(line)
end program summary_line_report_demo
internal write
`write(line, ...)` formats text into a character variable.
trim
`trim(line)` removes trailing blanks before printing.
summary line
The report combines fixed labels and calculated counts.