`Damage Stability Report with a Table of Contents `loop over a set of predefined damage cases which are stored in numbered variables dc1, dc2, ..., dcN. `At the start of each damage case record the page number to a message report file. `After the damage cases are finished, create a new report, view the message report and then append the data report. clear clear all project TOC macro calcs solve status page 97% ra 0 2.5s ... 30s /lim ra 0 2.5p ... 30p /lim / macro cases `%1:damage case number tank "{dc%1}" type flood subtitle DAMAGE Case %1 - {dc%1}\ if {repfile}="" then report {project}.pf /p:2 page 97% `create string for the table of contents line set s=%1 set s="{s }- {dc{s}}" `damage case number and tanks macro add_dots set s="{s}." // set t=chars "{s}" plus chars "{pagenum}" set t=78 minus {t} minus 2 `number of dots to add between damage case and page set s="{s} " .add_dots({t}) `append dots set s="{s} {pagenum}" `append page number message "{s} .calcs type (*) intact tank off / variable (str) s `temporary string variable variable t `temporary variable `Damage Cases variable (str) dc1="CGC3.C" variable (str) dc2="CGC4.C" variable (str) dc3="CGC5.C" variable (str) dc4="CGC6.C" variable (str) dc5="CGC3.C, CGC4.C" variable (str) dc6="CGC3.C, CGC4.C, CGC5.c" variable (str) dc7="CGC3.C, CGC4.C, CGC5.C, CGC6.c" variable (str) dc8="WBFPK.C" variable (str) dc9="WBFPK.C, FODT1.S" variable (str) dc10="WBFPK.C, FODT1.P" variable (str) dc11="WBFPK.C, FODT1.S, FODT1.P" variable (str) dc12="FODT1.S, CGS1.S" `add cases here. read tanker.gf weight 5800, 48.1f, 0.05p, 6.0 limit ra at max > .12 limit angle from equ to ra0 or fld > 16 `main report started by macro cases. message (report) toc.dat message " TABLE OF CONTENTS message " message "Damage Case Page .cases(12,1) 1 `call once for each damage case message (report) off report off subtitle Damage Stability\ report final.pf /p:1 view toc.dat report off copy {project}.pf final.pf /append print final.pf /preview