On Fri, 14 Aug 2020 23:45:19 +0300, ITschak Mugzach wrote:

>I once wrote an installer that behaved like a zip exec. I think it was
>discussed here as well. The idea is like the sample code below that
>demonstrates reading panel from the program body for later saving it in a
>temporary file. Remember That as this is not a comment the data that you
>can store instream is limited as the rexx restrictions apply here (for
>example /* will fail the program.
> 
I've done this with a few tweaks:
o I *do* put the instream data in a comment to avoid problems with
  lookahead by the Rexx interpreter reporting syntax errors.  I have
  not needed to deal with embedded comment delimiters; I could
  encode them if necessary.
o SOURCELINE returns the line number of the final line in the program if you 
omit n 
  (from the TSO/E Rexx Ref.), not "this line number".  So I put my instream data
  after the call to DataStack and use SIGL in DataStack.
o I let DataStack fetch the instream data rather than putting it after
  the call.  Purely a matter of style.
o You don't need to initialize xData because "until" tests at end of loop.
   But you may need to ensure that "EOF" is not treated as data.
o For generality you could pass the terminator as an arg to DataStack.

>I think I have to supply Lionel with some ISPF tricks that he can add to
>his manual...
>
Yes.

>ITschak
>
>/* Rexx */
>Call DataStack
>xData = ''
>Do I = StackStart + 2 until xData = 'EOF' /* StackStart + 2 is the line
>number of )ATTR */
>   /* READ PANEL FROM INSTREAM DATA */
>
>   .....
>   Ens
>Return
>DataStack:
>   StackStart = SourceLine()  /* get this line number */
>   Return
>)ATTR DEFAULT(...)
>)BODY
>)INIT
>....
>)PROC
>....
>
>)END
>EOF

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to