For NetRexx Pipelines, I am going to add a new method to utils.nrx. It is to search an argument string for a key word or abbreviation. /* An alternative way of presenting this function (less Rexx-like and more Java-like) would be to make it a class with getter methods. Your comments, ideas, etc. are all requested and welcomed. Jeff _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Jeff, sounds EXCELLECENT for me (as all from Your shop :-)) One question (sorry): What is a DString and a QWord ? Sorry for my ignorance :-( Tom. ================================================================================== Am 30.08.2020 um 20:36 schrieb Jeff
Hennick:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
DString: Delimited string has been a Pipeline staple. It is used as in Xedit's locate. Usually as /some string/ but any character can be the delimiter, although a non-alphanumeric is recommended. QWord: Quoted word, as a name, has recently been introduced by me. It is "a word, optionally in quotes, if there spaces are within it, it must be quoted." A use of this is for a file name; it is often a single word, but could contain spaces, and might include a path that has spaces, but the program treats it syntactically as a single word. (In the training business, we used to say "We cure ignorance, but stupidity is forever." And it is wise to recognize the difference, especially in oneself.) I have been using a variant of this Method in some of the stages
I have written, and think it is (past) time to factor it out,
standardize it, and make it available to all stage programmers. On 8/30/2020 5:18 PM, Thomas Schneider
wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jeff Hennick-3
On 2020-08-30 13:36:57 Jeff Hennick wrote:
> <html> > <head> > > <meta http-equiv="content-type" content="text/html; charset=UTF-8"> > </head> > <body> > <p>For NetRexx Pipelines, I am going to add a new method to > <b>utils.nrx</b>. It is to search an argument string for a key word or > abbreviation.</p> <p>/*<br> > getKeyWord(argString, key, minKeyLength = 0, type = 'K')<br> > <br> > This searches a string for a word or its abbreviation. It is for > searching argument strings<br> > for key words. A minKeyLength of '' or 0 means the full length > is needed.<br> > The search is case independent. What it returns depends on the > Key.<br> > <br> > Key values (Only the first character is used):<br> > -- Key: return boolean exists;<br> > -- Subword: return next word;<br> > -- Dstring: return DString<br> > -- Qword: return QWord<br> > <br> > It returns a Rexx Indexed string of what it found including the<br> > original string with the keyword (and Subword, Dstring, or Qword) > removed.<br> > If the key word is not found the original string is returned.<br> > <br> > returns:<br> > [0] 5 -- number of return strings<br> > [1] the argString without the keyword & subkeyword(s)<br> > [2] the subkeyword(s) value (or for type Key 1: keyword found | > 0: keyword not found)<br> > [3] the actual keyword found, this may be an abbreviation or > mixed case <br> > [4] the delimiter for types Dstring and Qword<br> > [5] the word number of the keyword, 0 for not found<br> > */<br> > </p> > <p>An alternative way of presenting this function (less Rexx-like > and more Java-like) would be to make it a class with getter > methods.</p> > <p>Your comments, ideas, etc. are all requested and welcomed.</p> > <p>Jeff<br> > </p> > </body> > </html> You are calling it getKeyWord instead of abbrev to avoid a collision? Leslie _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Leslie, Thank you for your interest. I'm not clear on your question, but will try to answer it as I read it. Yes, any new method should avoid name collision, in the program, and more important, in the mind of both the reader and writer. But this is so much more than abbrev, either the NetRexx method or the Pipeline stage and used under different circumstances than either of those. It is convenience method for scanning the argument string passed to a Pipeline stage, just as that string is scanned for ranges, etc. Yes, it uses the abbrev method as needed, internally. But it returns so much more, including the now excised string for further processing. As an example of where it could be used, here is part of the diagram for the DATECONVERT stage: +-- 1-*
------------------------+ It would be used in processing the argString for the stage to see
if the keyword TIMEOUT, MIDNIGHT, NOW, or WINDOW, etc. is present
and get the value for WINDOW. None of these would be using the
abbrev method part at all, but if it were used to see if SHOrtdate
were in there, it would use abbrev. It, in its current iteration, has limitations that I will add to the comments. This includes that in searching for a given keyword, it does not know about quoted or delimited strings, so looks inside them too, stopping at the first instance of the key. I will also add that, if given "" for a key, and searching for a DString, it will look at the left end of the string, that is, after word[0]. If this does not answer your question, it is because of my faulty reading of your question. In that case, please help me with it. Jeff On 8/30/2020 6:43 PM, J Leslie Turriff
wrote:
On 2020-08-30 13:36:57 Jeff Hennick wrote:<html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> <p>For NetRexx Pipelines, I am going to add a new method to <b>utils.nrx</b>. It is to search an argument string for a key word or abbreviation.</p> <p>/*<br> getKeyWord(argString, key, minKeyLength = 0, type = 'K')<br> <br> This searches a string for a word or its abbreviation. It is for searching argument strings<br> for key words. A minKeyLength of '' or 0 means the full length is needed.<br> The search is case independent. What it returns depends on the Key.<br> <br> Key values (Only the first character is used):<br> -- Key: return boolean exists;<br> -- Subword: return next word;<br> -- Dstring: return DString<br> -- Qword: return QWord<br> <br> It returns a Rexx Indexed string of what it found including the<br> original string with the keyword (and Subword, Dstring, or Qword) removed.<br> If the key word is not found the original string is returned.<br> <br> returns:<br> [0] 5 -- number of return strings<br> [1] the argString without the keyword & subkeyword(s)<br> [2] the subkeyword(s) value (or for type Key 1: keyword found | 0: keyword not found)<br> [3] the actual keyword found, this may be an abbreviation or mixed case <br> [4] the delimiter for types Dstring and Qword<br> [5] the word number of the keyword, 0 for not found<br> */<br> </p> <p>An alternative way of presenting this function (less Rexx-like and more Java-like) would be to make it a class with getter methods.</p> <p>Your comments, ideas, etc. are all requested and welcomed.</p> <p>Jeff<br> </p> </body> </html>You are calling it getKeyWord instead of abbrev to avoid a collision? Leslie _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
On 2020-08-30 21:58:30 Jeff Hennick wrote:
> <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> > </head> > <body> > <p>Leslie,</p> > <p>Thank you for your interest.<br> > </p> > <p>I'm not clear on your question, but will try to answer it as I > read it. Yes, any new method should avoid name collision, in the > program, and more important, in the mind of both the reader and > writer. But this is so much more than abbrev, either the NetRexx > method or the Pipeline stage and used under different > circumstances than either of those. It is convenience method for > scanning the argument string passed to a Pipeline stage, just as > that string is scanned for ranges, etc. Yes, it uses the abbrev > method as needed, internally. But it returns so much more, > including the now excised string for further processing.</p> > <p>As an example of where it could be used, here is part of the > diagram for the DATECONVERT stage:</p> > <p><font face="monospace"> +-- 1-* > ------------------------+<br> > >>--DATECONVert--+-------------------------------+------------------- >--------><br> +-| Separator |--| Inputrange |-+<br> > <br> > +-SHOrtdate ISOdate---------------------+ +-WINDOW > -50------------+<br> > >---+---------------------------------------+--+-----------------------+ >------><br> | +-ISOdate----------+ > +-WINDOW--signednumber--+<br> > +-| Inputformat |-+--+------------------+ > +-BASEYEAR--yearnumber--+<br> > | +-PREFACE-+ | +-| Outputformat |-+<br> > +-NOW-+-(5)-----+-+<br> > +-APPEND--+<br> > +--MIDNIGHT--(4)-+<br> > >--+-----------+--+----------------+------------------------------------ >---->><br> +--TIMEOUT--+ +--NOON--(4)-----+<br> > </font></p> > <p>It would be used in processing the argString for the stage to see > if the keyword TIMEOUT, MIDNIGHT, NOW, or WINDOW, etc. is present > and get the value for WINDOW. None of these would be using the > abbrev method part at all, but if it were used to see if SHOrtdate > were in there, it would use abbrev.<br> > </p> > <p>It, in its current iteration, has limitations that I will add to > the comments. This includes that in searching for a given > keyword, it does not know about quoted or delimited strings, so > looks inside them too, stopping at the first instance of the key. > I will also add that, if given "" for a key, and searching for a > DString, it will look at the left end of the string, that is, > after word[0].</p> > <p>If this does not answer your question, it is because of my faulty > reading of your question. In that case, please help me with it.</p> > <p>Jeff<br> > </p> > <div class="moz-cite-prefix">On 8/30/2020 6:43 PM, J Leslie Turriff > wrote:<br> > </div> > <blockquote type="cite" > cite="mid:[hidden email]"> > <pre class="moz-quote-pre" wrap="">On 2020-08-30 13:36:57 Jeff > Hennick wrote: </pre> > <blockquote type="cite"> > <pre class="moz-quote-pre" wrap=""><html> > <head> > > <meta http-equiv="content-type" content="text/html; > charset=UTF-8"> </head> > <body> > <p>For NetRexx Pipelines, I am going to add a new method to > <b>utils.nrx</b>. It is to search an argument string for a key > word or abbreviation.</p> <p>/*<br> > getKeyWord(argString, key, minKeyLength = 0, type = 'K')<br> > <br> > This searches a string for a word or its abbreviation. It is for > searching argument strings<br> > for key words. A minKeyLength of '' or 0 means the full length > is needed.<br> > The search is case independent. What it returns depends on the > Key.<br> > <br> > Key values (Only the first character is used):<br> > -- Key: return boolean exists;<br> > -- Subword: return next word;<br> > -- Dstring: return DString<br> > -- Qword: return QWord<br> > <br> > It returns a Rexx Indexed string of what it found including > the<br> original string with the keyword (and Subword, Dstring, or > Qword) removed.<br> > If the key word is not found the original string is > returned.<br> <br> > returns:<br> > [0] 5 -- number of return strings<br> > [1] the argString without the keyword &amp; > subkeyword(s)<br> [2] the subkeyword(s) value (or for type Key 1: > keyword found | 0: keyword not found)<br> > [3] the actual keyword found, this may be an abbreviation or > mixed case <br> > [4] the delimiter for types Dstring and Qword<br> > [5] the word number of the keyword, 0 for not found<br> > */<br> > </p> > <p>An alternative way of presenting this function (less Rexx-like > and more Java-like) would be to make it a class with getter > methods.</p> > <p>Your comments, ideas, etc. are all requested and > welcomed.</p> <p>Jeff<br> > </p> > </body> > </html> > </pre> > </blockquote> > <pre class="moz-quote-pre" wrap=""> > You are calling it getKeyWord instead of abbrev to avoid a collision? > > Leslie > _______________________________________________ > Ibm-netrexx mailing list > <a class="moz-txt-link-abbreviated" > href="mailto:[hidden email]">[hidden email]</a> > Online Archive : <a class="moz-txt-link-freetext" > href="https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215 >625.n3.nabble.com_&d=DwMDaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1 >fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=anS2nJ4rX_Xz-iUDU3PRo80FjjLWZRyPapT >7HQlXmf8&s=c4TR4WgKLEvClmVLk7bFncN-MIlMETcmBqpYpr80Xw4&e="><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__ib&d=DwQFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=xJFGAuf2dZo_QsR0Vt6hFcyqei01sdWdH7sVBUR82tI&s=weRKkkc3eLwdMHjS_ll5u5ScIxTn2d8t9qiIMuyZmjk&e=">http://ib</a> >m-netrexx.215625.n3.nabble.com/</a> > > </pre> > </blockquote> > </body> > </html> No, I understand now that this is an internal function that the user does not actually invoke. Thanks, Leslie _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Free forum by Nabble | Edit this page |