home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / 123rexx.zip / REXXABRV.CMD < prev    next >
OS/2 REXX Batch file  |  1992-12-22  |  2KB  |  33 lines

  1. /*****************************************************************************/
  2. /* Lotus 1-2-3 For OS/2 sample @function.                                               */
  3. /*                                                                                                   */
  4. /* @REXX("REXXABRV.CMD",word,range,minLength)                                */
  5. /*                                                                                                   */
  6. /* Returns 1 if 'word' is an abbreviation of a word in 'range', returns 0 if */
  7. /* not.                                                                                              */
  8. /*                                                                                                   */
  9. /* @REXX("REXXABRV.CMD logFileName",word,range,minLength)                    */
  10. /*                                                                                                   */
  11. /* Writes any TRACE or SAY output to a log file named 'logFileName'.         */
  12. /*                                                                                                   */
  13. /* Copyright (c) 1991 Lotus Development Corporation.    This code is supplied  */
  14. /* on an 'as is' basis as an example only.  This code has only received      */
  15. /* informal testing by Lotus.  Permission is granted    to copy and modify      */
  16. /* this code to your heart's content.  No warrenties expressed or implied.   */
  17. /* Remember, your mileage may vary.  Let us know if you find support of REXX */
  18. /* by 1-2-3 useful.                                                                              */
  19. /*****************************************************************************/
  20. TRACE R
  21. PARSE ARG word, field, minimum
  22. IF word = "?" THEN SIGNAL Tell    /* give info if called with "?" as 1st arg */
  23. IF field <> "RANGE1" THEN SIGNAL Tell        /* expecting a range as 2nd arg */
  24. IF minimum = "" THEN minimum = 1         /* set default minimum abbreviation */
  25. DO i = 1 TO range1.0                       /* loop through the cells of the range */
  26.     IF Abbrev(range1.i, word, minimum) = 1 THEN RETURN 1
  27.     END
  28. RETURN 0                                                          /* no abbreviation found */
  29.  
  30. Tell:                                                       /* return a brief description */
  31. RETURN '@REXX("REXXABRV.CMD",word,range,minLength) ==> returns 1 if' ,
  32.     "'word' is an abbreviation of a word in 'range'."
  33.