/*REXX program illustrates how to display embedded documentation (help) within REXX code*/
parse arg doc /*obtain (all) the arguments from C.L. */
if doc='?' then call help /*show documentation if arg=a single ? */
/*■■■■■■■■■regular■■■■■■■■■■■■■■■■■■■■■■■■■*/
/*■■■■■■■■■■■■■■■■■mainline■■■■■■■■■■■■■■■■*/
/*■■■■■■■■■■■■■■■■■■■■■■■■■■code■■■■■■■■■■■*/
/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■here.■■■■■*/
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
help: ?=0; do j=1 for sourceline(); _=sourceline(j) /*get a line of source.*/
if _='' then do; ?=1; iterate; end /*search for */
if _='' then leave /* " " */
if ? then say _
end /*j*/
exit /*stick a fork in it, we're all done. */
/*══════════════════════════════════start of the in═line documentation AFTER the
To use the YYYY program, enter one of:
YYYY numberOfItems
YYYY (no arguments uses the default)
YYYY ? (to see this documentation)
─── where: numberOfItems is the number of items to be used.
If no "numberOfItems" are entered, the default of 100 is used.
════════════════════════════════════end of the in═line documentation BEFORE the */