Bug while Parsing with variable patterns

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug while Parsing with variable patterns

Jeff Hennick-2
-- test of parse
-- 98/6/6 Jeff Hennick

say version

trace results

data = '5 some data in here'
n = 10

parse data n first =(n) second            <-- should work per TNRL, P129

say first  first.length
say second                    



NetRexx 1.140 26 May 1998
    --- t.nrx
  8 *=* data = '5 some data in here'
    >v> data "5 some data in here"
  9 *=* n = 10
    >v> n "10"
 11 *=* parse data n first =(n) second
    >v> n "5"                             <-- n gets set
    >v> first "some da"                   <-- but old value of n is used
    >v> second "ta in here"
 13 *=* say first  first.length
    >>> "some da 7"
some da 7
 14 *=* say second
    >>> "ta in here"
ta in here


The work around is to use two separate parse clauses, the first to get the
value of n, the second to use it.

Jeff Hennick  [hidden email]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>