From: Jeff H. <Je...@Je...> - 2020-09-18 16:14:08
|
<html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> <p>I have updated the method <b>sortInsertInto(list, new[, strict])</b>, adding the third, optional, argument. There are a few stages where having a quick internal sort is useful.<br> </p> <p>/* Insert a new item into a sorted list in a Rexx indexed variable.<br> Returns the list with new inserted.<br> Indexed by integers from 1.<br> Index 0 is a count of the other values.<br> If strict = 1 or the first character is 'S' or 's', then strict<br> compare, <<, is used, otherwise normal compare, <, is used. */<br> </p> <p>And added a new method <b>getAnycase(argstr)</b> useful in scanning argument strings<br> </p> <p>/* Checks first word of argstr for ANYCASE or alias, uses caseless compare.<br> Returns 1 = found ANYCASE<br> 0 = not found<br> -1 = found RESPECTCASE */</p> <p>By scanning for and reporting <b>RESPECTCASE</b>, which is the currently unvoiced default in many stages, it opens the use of stating this option to add to the readability of the resulting code. Most stages would note it and ignore it as the default.</p> <p>Anticipated usage is like this</p> <font face="monospace">args = arg()</font><br> <font face="monospace">ac = getAnycase(args)</font><br> <font face="monospace">if ac <> 0 then args = args.subword(2) -- found a case option remove it</font><br> <font face="monospace">if ac < 0 then ac = 0 -- ignore RESPECTCASE if found</font><br> <font face="monospace">-- continued scanning of the arg string<br> </font><font face="monospace">...</font><br> <font face="monospace">if ac then xxxx.upper -- use the anycase option if selected</font> <p>Of course this finds all the acceptable aliases, ANYCASE ANYCAS ANYCA ANYC CASEANY CASEIGNORE CASELESS IGNORECASE. <br> </p> <p>Jeff<br> <font face="monospace"></font></p> <p><font face="monospace"><br> </font></p> <br> </body> </html> |