/*REXX program creates (and displays) an HTML table of five rows and three columns.*/ parse arg rows . /*obtain optional argument from the CL.*/ if rows=='' | rows=="," then rows=5 /*no ROWS specified? Then use default.*/ cols = 3 /*specify three columns for the table. */ maxRand = 9999 /*4-digit numbers, allows negative nums*/ headerInfo = 'X Y Z' /*specifify column header information. */ oFID = 'a_table.html' /*name of the output file. */ w = 0 /*number of writes to the output file. */ call wrt "" call wrt "
" call wrt "" call wrt "| " /*when it's the zeroth row. */ else call wrt " | ||
|---|---|---|
| " r " | " /* " " not " " " */ do c=1 for cols /* [↓] for row 0, add the header info*/ if r==0 then call wrt "" word(headerInfo,c) " | " else call wrt "" rnd() " | " end /*c*/ end /*r*/ call wrt "