From: <hp...@we...> - 2022-06-10 08:49:35
|
Hi! Now I do need having a blocnote to jot things down, since ooRexx 5.oo is on another machine than my mail system. The example from Gil Barmwater shown some days ago on [oorexx:discussion] now works: > fn.0 = 3 > fn.1 = 'Tom' > fn.2 = 'Dick' > fn.3 = 'Harry' > do n = 1 to fn.0 > queue fn.n > end > > rx = 'rexx -e' > rs = '"do while queued()>0;parse pull l;say l;end"' > runpipe = 'java org.netrexx.njpipes.pipes.runner' > pipeln = '"console | reverse | console"' > rx rs "|" runpipe pipeln But, this NetRexx pipe runs without knowledge about neither NETREXX_HOME nor CLASSPATH, what makes me wonder. That's the way to pass content of ooRexx variables to the NetRexx Pipeline. For the other way round, to save results to variables I have installed BSF4ooRexx, but not yet conducted a first trial with it. Hello Rony! You advised to use BsfContextVariables() to set, get, or drop variables of the _current_ variable pool. Please define "current" ;) The first pipe of my VilMA.rx to be converted to NetRexx Pipelines is: > fn = vilma.ini > call RxPipe '< "' || fn || '"!nlocate 1 /*/!varset' what I'd like to convert to > ripe = '@java -cp "', > || value("NETREXX_HOME", , "ENVIRONMENT"), > || '\lib\NetRexxF.jar;', > || value("CLASSPATH", , "ENVIRONMENT"), > || '"' 'org.netrexx.njpipes.pipes.runner' > fn = vilma.ini > ripe '"(sep !) <' fn '!varload"' In contrast to the varset stage, varload will filter by default comments and blank lines before doing something like > loop forever > line = Rexx peekto() /* readto() would do in this case */ > parse line.upper sc +1 vn (sc) sv > BSFContextVariables("Set", vn, sv) > readto() > end My question is, how does BSFContextVariables() "know" which pool to use? From my point of view, there are several available in this context: one of the stage involving BSFContextVariables(), another one of ooRexx that started the NetRexx pipe, which itself could be a method of a method of... and so on, resulting in several pools within the same program/application. And does it make a difference if BSFContextVariables() is called in a stage which was involved by callpipe or addpipe? Is that described or documented somewhere? TIA! Best, M. Am 07.06.2022 um 14:30 schrieb Rony G. Flatscher: > On 6/6/2022 10:23 PM, René Jansen wrote: > ... cut ... >> [...] >>> OK, back to the subject. >>> Additional question: if I would program a VARLOAD stage or alike, >>> and set there some variables according the data trickling through >>> the pipe, would those be set within the VARLOAD routine only or >>> for the NetRexx program which called the pipe in question? Would >>> this also be possible from ooRexx? Probably not, but is there a >>> chance to access a "common pool" from both "dialects"? Something >>> adequate the GLOBALV concept of VM/CMS? Well, that would require >>> some kind of "pull" in ooRexx after the NetRexx pipe finished, a >>> "push" of the results (variables set directly) would be more >>> appropriate. >>> >> We have to speak to Rony about this, I am sure BSF4ooRexx has a >> fitting solution here. > > with BSF4ooRexx you would have the ability to get and set any Rexx > variable in the current context. > > BSF4ooRexx would allow to create the classic Rexx exits in Java > and using BSF4ooRexx already one could even implement them in > ooRexx! :) > > [Planning on adding support for the redirectable environmentto > BSF4ooRexx introduced in ooRexx 5, once I have a little bit of > free time on my hands. Probably sometimes in the summer.] > > It should be possible to write stages in ooRexx, if there is a > Java interface definition for stages in the NetRexx pipes. If so, > please point it out (not having had my fingers on NetRexx pipes > just as of yet, short of time, but very interested in this > infrastructure) and I try to come up with an example. > > ---rony > > > > > _______________________________________________ > netrexx-pipelines mailing list > net...@li... > https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines |