home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / v / vsnbl220.zip / VOWELS.SNO < prev    next >
Text File  |  1991-02-14  |  946b  |  41 lines

  1. *    VOWELS.SNO
  2. *
  3. *    Sample program to read a file and display all lines containing
  4. *    double vowels.  The FIRST occurrence of the double vowels are
  5. *    underlined.
  6. *
  7. *    By simply changing the TARGET pattern, any desired letter pattern
  8. *    may be found.  For example, to find two vowels separated by a
  9. *    consonent, set:
  10. *
  11. *        TARGET = ANY(VOWEL) NOTANY(VOWEL " ,.-") ANY(VOWEL)
  12. *
  13.  
  14.  
  15.     &TRIM    =    1
  16.     VOWEL    =    'AEIOUaeiou'
  17.  
  18. *    Define target pattern
  19. *
  20.     TARGET    =    ANY(VOWEL) ANY(VOWEL)
  21.  
  22. *    Search pattern brackets the target with cursor operators.  I and J
  23. *    will be set to the subject positions on either side of the match.
  24. *
  25.     SEARCH    =    @I TARGET @J
  26.  
  27. *    Read a line of input, fail upon end-of-file.
  28. *
  29. READ    LINE    =    INPUT                :F(END)
  30.  
  31. *    Search the line.  Fail if not found.
  32. *
  33.     LINE    SEARCH                    :F(READ)
  34.  
  35. *    Success!  Display the line, and a underline the match points.
  36. *
  37.     OUTPUT    =    LINE
  38.     OUTPUT    =    DUPL(" ",I) DUPL("-",J - I)    :(READ)
  39.  
  40. END
  41.