home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / quotword.zip / README next >
Text File  |  1998-05-27  |  2KB  |  32 lines

  1.  
  2. Function name: w.cmd
  3. Author:        Peter Flass <Flass@LBDC.Senate.State.NY.US>
  4. Function:      Provides functionality simpiar to REXX's
  5.                builtin 'word()' function, but recognizes
  6.                quoted strings as a single word.
  7. Usage:         To use as a standalone function, include in
  8.                your searchpath.  To use as an imbedded function,
  9.                remove the comments surrounding the line 'W:Procedure'
  10.                and include in your Rexx command.
  11.                
  12.                In either case, call via:
  13.                   result = w(string_to_scan,word_number)
  14.                where 'string_to_scan' is the character string to be examined
  15.                and 'word_number' is the number of the word to be extracted
  16.                (1 thru the number of 'words' in the string)
  17.  
  18.                A 'word' is either a blank-delimited string of characters
  19.                without surrounding quotes (may contain embedded quotes)
  20.                or a blank-delimited quoted string which may contain
  21.                embedded blanks, etc.  The types of quotes used must match
  22.                (' with ', " with ").  Two consecutive matching quotes
  23.                will be translated to a single quote.  The enclosing quotes 
  24.                are removed from the result string.
  25.  
  26.                Examples:
  27.                  W('abc def',2)         -> def
  28.                  W(" 'abc def' ghi ",2) -> ghi
  29.                  W(' ''abc'' def',1)    -> 'abc'
  30.                  W('abc',2)             -> null string ('')
  31.  
  32.