TEA Tutorial

TEA HomeTutorial IndexPrevious StepNext Step


1.7 Using Macros

If you repeatedly enter the same sequences in a TEA pattern, you can save typing by using one of the TEA macros. A macro is a single character in a pattern (either @ or #) that is replaced by the actual sequence you want.

Macros are particularly useful as a shorthand for choice lists (see Step 3) because of their length. By default, @ expands to [aeiou] (a choice list meaning any vowel) and # expands to [^aeiou] (a choice list meaning any consonant).

The first example uses the default definitions of the macros. Suppose you were looking for ten-letter words consisting of pairs of consonants and vowels in alternation. Using macros saves typing the ten choice lists that would otherwise be needed:

Step 7 initial image

Type ##@@##@@## into the box below the Pattern label and click on the Word Search button. TEA finds several ten-letter words to match the pattern, which in expanded form would be:

[^aeiou][^aeiou][aeiou][aeiou][^aeiou][^aeiou][aeiou][aeiou][^aeiou][^aeiou]

Although vowel and consonant searching is the suggested use for the macros, you can define them to expand to any sequence you like. For the next example, suppose that we're constructing a crossword which will have distinct areas depending on whether the letter used is (or is not) in the word SCOTLAND - perhaps with the letters in SCOTLAND indicating a blue color (with the letters not in SCOTLAND left white) to produce the national flag of Scotland. That situation can be represented with macros which expand to the choice lists [scotland] and [^scotland].

You use the TEA options dialog to change the way macros are expanded. Use the Tools|Options... command and click on the Pattern tab if it isn't already shown. The TEA Options dialog should appear as shown below:

Step 7 intermediate image

Click into the box to the right of the @ becomes: label and edit the text so that it reads [scotland]. Then click into the box to the right of # becomes: and edit the text so that it reads [^scotland]. The TEA Options dialog should now look like this:

Step 7 intermediate image

These new sequences will now be used whenever @ or # appear in a pattern:

Step 7 intermediate image

Type ###@@@@@@@ (three # and seven @ characters) into the box below the Pattern label and click on the Word Search button. The first three letters of each word will use letters not in SCOTLAND. The last seven letters of each word will use letters in SCOTLAND. Here's a complete crossword grid based on the idea:

Step 7 final image

In the next step, we'll learn how to search for punctuation.


Relevant Help Sections

Macros
Options Pattern Tab

TEA HomeTutorial IndexPrevious StepNext Step


You can use the Contact Us Form to comment on this page.
Last updated: $Date: 2010/06/03 20:50:14 $
Material Copyright © 2010 Crossword Man