/* REXX exec to display 'help' screen for the EHIxxxx macros          */
/*** trace ?r ***************************************************** \| *
*               (C) Copyright Robert AH Prins, 2007-2016               *
************************************************************************
*  ------------------------------------------------------------------  *
* | Date       | By   | Remarks                                      | *
* |------------+------+----------------------------------------------| *
* |            |      |                                              | *
* |------------+------+----------------------------------------------| *
* | 2016-11-18 | RAHP | Update for changed options                   | *
* |------------+------+----------------------------------------------| *
* | 2009-07-02 | RAHP | Add help for Compact HTML option             | *
* |------------+------+----------------------------------------------| *
* | 2009-04-22 | RAHP | Update comment                               | *
* |------------+------+----------------------------------------------| *
* | 2009-04-01 | RAHP | Add help for font selection item             | *
* |------------+------+----------------------------------------------| *
* | 2009-02-09 | RAHP | RACF problem with 'html' extension @ NVSM    | *
* |------------+------+----------------------------------------------| *
* | 2007-09-24 | RAHP | Additional help                              | *
* |------------+------+----------------------------------------------| *
* | 2007-09-18 | RAHP | Add GPL V3 License                           | *
* |------------+------+----------------------------------------------| *
* | 2007-09-06 | RAHP | Cater for PC environment                     | *
* |------------+------+----------------------------------------------| *
* | 2007-08-30 | RAHP | Initial version                              | *
* |------------+------+----------------------------------------------| *
************************************************************************
* EHIHELP is a REXX exec containing the 'HELP' screens for the various *
* other EHIxxxx execs.                                                 *
*                                                                      *
* t_rex will contain the environment. It can be:                       *
*                                                                      *
* - TSO     - TSO/ISPF                                                 *
* - MVS     - z/OS (PGM=IRXJCL)                                        *
* - SYSTEM  - Regina                                                   *
* - COMMAND - PC DOS 7/2000                                           *
* - CMD     - Object REXX (OS/2, Windoze)                              *
************************************************************************
* Send questions, suggestions and/or bug reports to:                   *
*                                                                      *
* robert@prino.org / robert.ah.prins@gmail.com                         *
*                                                                      *
* Robert AH Prins                                                      *
* Taboralaan 46                                                        *
* 8400 Oostende                                                        *
* Belgium                                                              *
************************************************************************
* This program is free software: you can redistribute it and/or        *
* modify it under the terms of the GNU General Public License as       *
* published by the Free Software Foundation, either version 3 of       *
* the License, or (at your option) any later version.                  *
*                                                                      *
* This program is distributed in the hope that it will be useful,      *
* but WITHOUT ANY WARRANTY; without even the implied warranty of       *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the         *
* GNU General Public License for more details.                         *
*                                                                      *
* You should have received a copy of the GNU General Public License    *
* along with this program. If not, see <http://www.gnu.org/licenses/>  *
***********************************************************************/
parse source source
parse value source with . . moi . . . cmdenv aspace .

t_rex   = address()
macmode = 0

if t_rex  = 'TSO' &,
   aspace = 'ISPF' then
  do
    macmode = 1
    "isredit macro (parm)"
  end
else
  arg parm

parm = translate(parm)

line.  = ''
type.  = 'NOTE'
i      = 1

text   = 'The' parm 'edit macro'
line.i = center(text, 72)
type.i = 'MSG'
i      = i + 1
line.i = center(left('~', length(text), '~'), 72)
type.i = 'MSG'
i      = i + 1
line.i = center(' Use DOWN to read all "HELP" screens ', 72, '*')
type.i = 'MSG'

i      = i + 2
line.i = '  'center('(C) Copyright Robert AH Prins, 2007-' ||,
         left(date('S'), 4), 70)

i      = i + 2
line.i = '  The' parm 'edit macro can be used to convert all',
         '(or part) of the'
i      = i + 1
line.i = '  member being edited to HTML, with coloring that',
         'matches as closely'
i      = i + 1
line.i = '  as possible the HILITE-ing that the ISPF editor',
         'provides after the'
i      = i + 1
line.i = '  "HI RESET" and "HI PAREN" commands.'

i      = i + 2
line.i = '  The generated HTML file can (optionally) be',
         'downloaded to a PC and'
i      = i + 1
line.i = '  (optionally) be displayed using the application',
         'that is associated'
i      = i + 1
line.i = '  with the ''.html'' extension (eg Firefox).'

i      = i + 2
line.i = '  Usage:'
type.i = 'MSG'

i      = i + 2
line.i = '  - Full member'
type.i = 'MSG'

i      = i + 2
line.i = '    To convert a whole member (Warning: this may',
         'take considerable'
i      = i + 1
line.i = '    time on large members!) just enter "'parm'" on the',
         'command line'
i      = i + 1
line.i = '    and press ENTER.'

i      = i + 2
line.i = '  - Partial member (This option is ignored for EHISUPC)'
type.i = 'MSG'

i      = i + 2
line.i = '    To convert selected lines from the current member,',
         'mark the lines'
i      = i + 1
line.i = '    to be converted with a "HInnnn" or two "HII" line',
         'commands, enter'
i      = i + 1
line.i = '    "'parm'" on the command line and press ENTER.'

i      = i + 2
line.i = '  Options:'
type.i = 'MSG'

i      = i + 2
line.i = '  After pressing ENTER a pop-up panel allows overriding',
         'a number of'
i      = i + 1
line.i = '  options that are pre-set in EHISUPP. The options and',
         'their defaults'
i      = i + 1
line.i = '  are:'

i      = i + 2
line.i = '  o View HTML  . . . . YES'

i      = i + 2
line.i = '    The generated dataset will be displayed using VIEW'

i      = i + 2
line.i = '  o HTML type  . . . . STD'

i      = i + 2
line.i = '    Options are'
i      = i + 1
line.i = '    - STD : Plain HTML'
i      = i + 1
line.i = '    - ISPF: Fancy scrollable ISPF VIEW like HTML'

i      = i + 2
line.i = '  o HTML font  . . . . Courier New'

i      = i + 2
line.i = '    Any (monospaced) font you fancy. The default',
         'is ''Courier New'', but'
i      = i + 1
line.i = '    ''Lucida Console'' would also be a good choice. Using',
         'a proportional'
i      = i + 1
line.i = '    font will NOT produce very fancy HTML!'

i      = i + 2
line.i = '  o Progress . . . . . 100'

i      = i + 2
line.i = '    Language dependent progress messages'

i      = i + 2
line.i = '  o xfer WSA . . . . . NO'

i      = i + 2
line.i = '    Auto-transfer the HTML file to the workstation,',
         'requires the'
i      = i + 1
line.i = '    Work Station Agent'

i      = i + 2
line.i = '  o PC directory . . . c:\temp'

i      = i + 2
line.i = '    Directory to use on the PC for auto-transfers'

i      = i + 2
line.i = '  o Start browser  . . NO'

i      = i + 2
line.i = '    Start the application associated with the',
         'extension ''.html'''

i      = i + 2
line.i = '  The pop-up panel can be suppressed by setting the',
         '''popup'' flag in'
i      = i + 1
line.i = '  EHISUPP to 0.'

i      = i + 2
line.i = center(' Legal information ', 72, '*')
type.i = 'MSG'

i      = i + 2
line.i = '  This program is free software: you can redistribute it',
         'and/or modify'
i      = i + 1
line.i = '  it under the terms of the GNU General Public License',
         'as published by'
i      = i + 1
line.i = '  the Free Software Foundation, either version 3 of the',
         'License, or (at'
i      = i + 1
line.i = '  your option) any later version.'

i      = i + 2
line.i = '  This program is distributed in the hope that it',
         'will be useful, but'
i      = i + 1
line.i = '  WITHOUT ANY WARRANTY; without even the implied',
         'warranty of'
i      = i + 1
line.i = '  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ',
         'See the GNU'
i      = i + 1
line.i = '  General Public License for more details.'

i      = i + 2
line.i = '  You should have received a copy of the GNU General',
         'Public License'
i      = i + 1
line.i = '  along with this program.  If not, see',
         '<http://www.gnu.org/licenses/>.'

i      = i + 2
line.i = center(' End of HELP information ', 72, '*')
type.i = 'MSG'
line.0 = i

if macmode         &,
   t_rex   = 'TSO' &,
   aspace  = 'ISPF' then
  do
    "isredit (STATE) = user_state"
    "isredit caps = off"

    do i = line.0 to 1 by -1
      lin = line.i
      "isredit line_after 0 = "type.i"line (LIN)"
    end

    "isredit user_state = (STATE)"
    "isredit locate 0"
  end
else
  do
    if t_rex = 'SYSTEM'  |,                            /* Regina      */
       t_rex = 'COMMAND' |,                            /* PC DOS 7    */
       t_rex = 'CMD' then                              /* Object REXX */
     "cls"

    do i = 1 to line.0
      say line.i
    end
  end
return