From: J L. T. <jlt...@ma...> - 2022-06-20 21:30:07
|
On 2022-06-19 04:40:13 hp...@we... wrote: > Hello Leslie! > > First -- I have to confess, the 'csvcln' stage I showed recently > is an example from VM/CMS running on codepage 273, not tested with > double-byte characters. The goal was, get rid of all superfluous > extras to make CSV tables comparable, whatever provenience. Thus > my suggestion of masking word separators might not work with > today's UTF-8 or -16 content. > > Next -- following remarks are neither NetRexx- nor Java-specific. > > Your succession of change stages makes me shiver ... > > > change /\n"/ /\n“/ | > > change / "/ / “/ | > > change /"\n/ /â€\n/ | > > ... because it uses arguments which /could/ be subject of > interpretation by a "funny" editor or other "helpful" tools I > don't know. You may consider my suggestion as paranoid to use only > hex values as arguments for Change (I didn't so in my csvcln, but > that was for a rather stable OS). You're quite right. I changed these to | change /\u000A\u0022/ /\u000A\u201C/ | | change /\u0020\u0022/ /\u0020\u201C/ | | change /\u0022\u000A/ /\u201D\u000A/ | etc., which should be safe. > > > loop while execOptions.words > 0 > > parse execOptions execOption execOptions > > select > > when 'help'.abbrev(execOptions.lower,1) then > > The variable execOption is very close to execOptions what is > pretty confusion prone. (BTW, there is a programming language > which allows looong variable names but the compiler utilizes the > first eight letters only.) > I'm not sure, the first When condition, could there be a little > 's' too much? This is intentional; execOptions, obtained from the previous parse command, | parse arg filePaths '[' execOptions ']' . contains (or can contain) multiple words. As the loop command, | loop while execOptions.words > 0 implies, the following parse command, | parse execOptions execOptions execOptions takes the first word (maybe the only word) from the variable execOptions and places it into execOption (the absence of the trailing s indicates it is only one option) and returns the rest of the list (maybe empty) to execOptions; this is a well-understood paradigm of the parse command. Since execOptions is used only to provide this list of options to the loop and is used for nothing else, there is little chance for harm. I could have given it a longer name, e.g. execOptionList, but as you say, some compilers have variable name length limitations. (The only one I can think of is FORTRAN, and that limit may have been removed by now.) Leslie > > Best, > M. -- Operating System: Linux Distribution: openSUSE Leap 15.4 x86_64 java version "18" 2022-03-22 NetRexx portable processor 4.03-GA build 260-20220503-1730 |