From: René J. <rvj...@xs...> - 2022-06-01 17:04:31
|
Hi Mike, > On 31 May 2022, at 22:51, hp...@we... wrote: > > Hello René! > > Thank you for your kind offer to give it a try to convert my > little toy to NetRexx Pipelines. > > I guess the "main" routine will remain an ooRexx program since I > use ooDialog for the Windows drudgery (or has NetRexx something > better for dialog windows?) So the task is "only" to get rid of > everything OS/2 Pipelines and redo it with something I have no > idea yet. In NetRexx, for user interfaces you mostly choose from the Java world, so Swing, AWT, SWT or JavaFx come to mind. > > It is the first time I "tele-collaborate" for programming. So I > have no clue what works best, one is master with the ideas and the > other the typist? Should we work top-down or simplest cases first, > the impossible later? Or do we an endless > question-and-answer-ping-pong? > I am a proponent of the model of sending something that works and then letting the other person go on with it. I am not afraid of endless q&a ping pong either. I would like to try the modern two-persons-in-an-edit session sometimes, but my days are not that plannable. > My first question would be, the "glue" code to get access to > pipelines is now > >> call RxFuncAdd 'RxPipe', 'RXPIPE', 'RXPIPE' In NetRexx there is no RxFuncAdd. You need to compile a class that uses pipes with the pipc compiler. There should be an alias or .bat file for that. Example: class stemtest method stemtest() a = Rexx 'abase' b = Rexx 1 a[0]=5 a[1]=11 a[2]=222 a[3]=3333 a[4]=444 a[5]=55 pipe (stempipe debug 0 ) stem a | prefix literal {a} | console | stem b loop i=1 to b[0] say 'b['i']='b[i] end method main(a=String[]) static stemtest() exit Since NetRexx 4.03 (that is about a month) you can also just use address and receive output in a stem: out ='' address pipe with output stem out “ | split | reverse | cons" do i=1 to out[0] say out[i] end This works from the normal NetRexx compiler, which most people alias to nrc. > > Does NetRexx need something similar? > > The first pipeline is to varload (or varset) the INI file: > >> fn = left(fid, lastpos('.', fid)) || 'ini' >> call RxPipe '< "' || fn || '"!nlocate 1 /*/!varset' ➜ test git:(master) ✗ cat varset.nrx vars ='' address pipe with output stem vars "< vars.ini | nlocate 1 /*/ | cons" do i=1 to vars[0] say vars[i] end ➜ test git:(master) ✗ cat vars.ini aap = 1 noot = 2 * mies = 3 wim = 4 ➜ test git:(master) ✗ nrc -exec varset.nrx NetRexx portable processor 4.04-alpha build 272-20220524-1803 Copyright (c) RexxLA, 2011,2022. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program varset.nrx ===== Exec: varset ===== aap = 1 noot = 2 wim = 4 Processing of 'varset.nrx' complete So that does more or less what you want already - the source redirect <, the nlocate works. If you want we can make a varset stage, I think we don’t have that at the moment but it cannot be too hard. René. > > Let's take this as a first try. When it works the rest should also > be doable. > > Best, > M. > > > _______________________________________________ > netrexx-pipelines mailing list > net...@li... > https://lists.sourceforge.net/lists/listinfo/netrexx-pipelines |