showit.rex: See "Purpose", below Copyright (C) 2015 Leslie L. Koehler This is free software. See "Notice:" at the bottom of C:\MyRexxStuff\showit.rex Author: Les Koehler vmrexx@tampabay.rr.com Purpose: Display the data items passed. Items can be a stem, a file (or a piece of one), a literal string or the definition of a variable that will be used for substituting its occurrences in lines from stems, literal strings, and/or files. For example: '&varname=txt' or '&varname='value As many items as needed can be used. A string that starts with ':' triggers Options processing. Valid options to change the defaults are: NOShow - Don't display the output file Quiet - Skip the Exit message when NOSHOW is used NOTepad - Allow testers to use NotePad Any number of Options lines can be used and any option can be negated by starting it with 'NO' (or not) as needed. Syntax: Call showit .context~name , [output fileid] , item [, item ...] The output fileid defaults to the caller appended with '_help.txt' Example: Call showit 'C:\MyRexxStuff\test.rex' , -- Caller , 'C:\Reports\Symposium.txt' , -- Output fle (optional) , 'Financial Data Report' , -- Literal string , stema. , stemb. , -- Stems , '1 5 C:\Sigs\Lesk.txt' , -- Lines 1-5 of a file , '1 * C:\temp\junk.txt' , -- The whole file , '7 eof C:\temp\test.txt' , -- Line 7 to end-of-file , ':quiet noshow' , -- Options , '&lcme='lcme -- Variable definition Help: showit [? | /? | -? | Help | /Help | -Help | --Help] Here's a real example, in the file C:\MyRexxStuff\showit.rex: HELP: xmpstart=thisline()-1 xmpend=thisline()+9 more='' if symbol('ARGS')='VAR' then more=':'args /* Allow options */ outvar=beghelp endhelp fullme /* startline endline & file to extract from */ Call Showit fullme ,, outvar , /* Caller , data to show */ ,more , /* Allow options to be tested from a command window */ ,"&lcsme="lcsme , '&sme='sme , '&this file.='fullme , /* Substitutions */ ,"&helps="helps , '&fullme='fullme , xmpstart xmpend fullme -- Note that the above 2 lines are NOT substituted when SHOWIT displays them. -- That's because of the double-quote before the first '&'.