From: René J. <rvj...@xs...> - 2021-10-31 13:39:00
|
Hi Colin, The only thing is, you cannot specify a .class extension after a filename when invoking java through the java.exe processor. This is outside of our control. Interestingly, I just ran the class, and the example uncovers an error in the sort stage, or so it seems. Just in time for NetRexx 4.0.2 - and your examples prompted a documentation change, there was too much left implicit. Best regards, René. > On 31 Oct 2021, at 06:49, Colin <net...@im...> wrote: > > Thanks Rene > > I am still a little confused though. > > I have a file called testpipe.nrx which has been copied from the Pipelines Quick Start manual > > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin>dir testpipe* > Volume in drive Z is OS > Volume Serial Number is 643B-12E5 > > Directory of z:\NetRexx-4.01-GA\bin > > 2021-10-28 05:23 PM 334 testpipe.nrx > 1 File(s) 334 bytes > 0 Dir(s) 1,038,705,549,312 bytes free > > z:\NetRexx-4.01-GA\bin>type testpipe.nrx > class testpipe > > method testpipe(avar=Rexx) > > F = Rexx 'abase' > T = Rexx 1 > > F[0]=5 > F[1]=222 > F[2]=3333 > F[3]=1111 > F[4]=55 > F[5]=444 > > pipe (apipe stall 1000 ) > stem F | sort | prefix literal {avar} | console | stem T > > loop i=1 to T[0] > say 'T['i']='T[i] > end > > method main(a=String[]) static > > testpipe(Rexx(a)) > z:\NetRexx-4.01-GA\bin> > > > My understanding is that I am supposed to use pipc to compile it. > > > z:\NetRexx-4.01-GA\bin>pipc testpipe > 16 +++ stem F | sort | prefix literal {avar} | console | stem T > +++ ^ > +++ Error: Unexpected character found in source: '{' (hexadecimal encoding: 007B) > > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin>dir testpipe* > Volume in drive Z is OS > Volume Serial Number is 643B-12E5 > > Directory of z:\NetRexx-4.01-GA\bin > > 2021-10-28 05:23 PM 334 testpipe.nrx > 1 File(s) 334 bytes > 0 Dir(s) 1,038,709,510,144 bytes free > > > Hmmm.. . . maybe I am supposed to call it testpipe.njp. Let's rename it. > > > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin>rename testpipe.nrx testpipe.njp > > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin>dir testpipe* > Volume in drive Z is OS > Volume Serial Number is 643B-12E5 > > Directory of z:\NetRexx-4.01-GA\bin > > 2021-10-28 05:23 PM 334 testpipe.njp > 1 File(s) 334 bytes > 0 Dir(s) 1,038,709,354,496 bytes free > > z:\NetRexx-4.01-GA\bin>pipc testpipe > pipe (testpipe_apipe stall 1000 ) stem F | sort | prefix literal arg(string 'avar'} | console | stem T > > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin>dir testpipe* > Volume in drive Z is OS > Volume Serial Number is 643B-12E5 > > Directory of z:\NetRexx-4.01-GA\bin > > 2021-10-30 10:31 PM 1,845 testpipe.class > 2021-10-28 05:23 PM 334 testpipe.njp > 2021-10-30 10:31 PM 4,180 testpipe_apipe.class > 2021-10-30 10:31 PM 314 testpipe_apipe_sortRexx_2.class > 4 File(s) 6,673 bytes > 0 Dir(s) 1,038,709,751,808 bytes free > > > This looks much more promising. Let's run it. > > > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin> > z:\NetRexx-4.01-GA\bin>java testpipe > Error: Unable to initialize main class testpipe > Caused by: java.lang.NoClassDefFoundError: org/netrexx/njpipes/pipes/ThreadQ > > That didn't work so I wonder if I am supposed to execute the testpipe_apipe.class instead. > > > z:\NetRexx-4.01-GA\bin>java testpipe_apipe.class > Error: Could not find or load main class testpipe_apipe.class > Caused by: java.lang.ClassNotFoundException: testpipe_apipe.class > > z:\NetRexx-4.01-GA\bin> > > > Not sure what I am doing wrong. > > Thanks > Colin > > > On 2021-10-30 07:23, René Jansen wrote: >> Hi Leslie, Colin, >> >> This source needs the pipes compiler - please try with pipc (pipc: aliased to java org.netrexx.njpipes.pipes.compiler) - it needs that step to sort out the variable inclusion. Colins analysis that the NetRexx compiler cannot handle this is correct. If you can include a version of the source that does not include | (pipes) at the start I can easier check that for you. >> >> Best regards, >> >> René. >> >> >>> On 28 Oct 2021, at 12:36, J Leslie Turriff <jlt...@ma...> <mailto:jlt...@ma...> wrote: >>> >>> I'm trying to use a simple pipeline in a NetRexx routine, but nrc doesn't like my >>> variable substitution: >>> >>> ~/bin/NetRexx >>> | $ echo $JAVA_HOME >>> | >>> | @05:27:11,leslie@pinto rc=0 >>> | ~/bin/NetRexx >>> | $ echo $CLASSPATH >>> | .:/home/leslie/bin/NetRexx/:/usr/java/jdk-17:/usr/local/NetRexx-4.01-GA/lib/NetRexxF.jar >>> | @05:27:21,leslie@pinto rc=0 >>> | ~/bin/NetRexx >>> | $ cat newTree.nrx >>> | -- .-----------------------------------------------------------------------. -- >>> | -- | Change Log | -- >>> | -- |Version Date Description | -- >>> | -- |------- ---------- ----------------------------------------------------| -- >>> | -- | | -- >>> | -- |1.0 2021-10-27 Creation | -- >>> | -- '-----------------------------------------------------------------------' -- >>> | import org.netrexx.njpipes.pipes. >>> | trace off >>> | parse arg treeBase >>> | treePipe(Rexx(treeBase)) >>> | exit 0 >>> | ------------------------------------------------------------------------------- >>> | method treePipe(treeArguments) >>> | pipe (fixTree) >>> | command /usr/bin/tree {treeArguments} >>> | | tree: split at /[/ >>> | | merge: specs select 1 1-* next >>> | select 0 1-* next >>> | select 2 1-* next >>> | | console >>> | ? tree: split at /]/ | attrs: >>> | ? attrs: | merge: >>> | --===========================================================================-- >>> | @05:27:31,leslie@pinto rc=0 >>> | ~/bin/NetRexx >>> | $ nrc newTree.nrx >>> | NetRexx portable processor 4.01-GA build 573-20210320-2000 >>> | Copyright (c) RexxLA, 2011,2021. All rights reserved. >>> | Parts Copyright (c) IBM Corporation, 1995,2008. >>> | Program newTree.nrx >>> | 16 +++ command /usr/bin/tree {treeArguments} >>> | +++ ^ >>> | +++ Error: Unexpected character found in source: '{' (hexadecimal encoding: 007B) >>> | Compilation of 'newTree.nrx' failed [one error] >>> | @05:27:40,leslie@pinto rc=2 >>> >>> I can't see what I'm doing differently to what is described in "How to use a pipe in a >>> NetRexx program", page 24 of "Pipelines Guide and Reference"; I tried first putting the >>> pipeline into the implicit main() method, then in a separate method; neither worked, so I >>> looked through the examples in the NetRexx package and noticed the import statement, but >>> adding that didn't help either. >>> What am I doing wrong? >>> >>> Leslie >>> -- >>> Distribution: openSUSE Leap 15.3 x86_64 >>> java version "17" 2021-09-14 LTS >>> Java(TM) SE Runtime Environment (build 17+35-LTS-2724) >>> Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing) >>> NetRexx portable processor 4.01-GA build 573-20210320-2000 >>> >>> >>> _______________________________________________ >>> netrexx-pipelines mailing list >>> net...@li... <mailto:net...@li...> >>> https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines <https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines> >> >> >> _______________________________________________ >> netrexx-pipelines mailing list >> net...@li... <mailto:net...@li...> >> https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines <https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines> > |