home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / ispell.lha / lookup.rexx < prev    next >
OS/2 REXX Batch file  |  1991-02-08  |  869b  |  31 lines

  1. /*  
  2.  *  lookup.rexx looks up a word using full regular expressions
  3.  *  (Note for beginners: . matches any character, .* matches any string)
  4.  *  using ISpell in ARexx server mode
  5.  *  Requires ISpell version 3.1ljr with ARexx Server mode.
  6.  *  Started: 12/27/90 LJR
  7.  *  Copyright (C) 1990  Loren J. Rittle
  8.  *  Use as you will, just document your changes and keep my copyright
  9.  *  notice intact.
  10.  */
  11. parse arg item cmdline
  12. options results
  13. if item = "" then do
  14.     say "Usage: lookup word1 word2 ..."
  15.     exit
  16. end
  17. if pos('IRexxSpell',(show(ports))) = 0 then do
  18.     'runback ispell -r >null: <null:'
  19.     waitforport 'IRexxSpell'
  20. end
  21. address 'IRexxSpell' lookup item
  22. r = result
  23. r1 = substr(r,1,1)
  24. select
  25.     when r1 = '&' then 
  26.         say "The pattern '"||item||"' matches:" substr(r,3)        
  27.     otherwise say "For the pattern '"||item||"' I got" r
  28.     end
  29. if cmdline ~= "" then call lookup cmdline
  30. exit
  31.