title: foreach for string values, manual list
body: <p>How can I create a loop of string values in Stata? A sample of what I am trying to do is mentioned below. I will have many other possible values in the list. I have gone through and made many manual lists, so I want to do it in a similar format to this, where you can look at the code and see the list.</p>
  
  <p>I've found questions on <code>foreach</code> and <code>forval</code>, but can't seem to find something directly related to <code>foreach</code> and string variable values? Am I missing something really simple?</p>
  
  <p><strong>tried this:</strong></p>
  
  <pre><code>foreach x of
  
  "GREEN BLUE" /// 
  
  "RED ORANGE" ///
  
   {
  
  replace y = 1 if COLOUR=="`x'" &amp; missing(y)
  
  } 
  </code></pre>
  
  <p><strong>and this:</strong></p>
  
  <pre><code>foreach x of {
  
  "GREEN BLUE" /// 
  
  "RED ORANGE" ///
  
   {
  
  replace y = 1 if COLOUR=="`x'" &amp; missing(y)
  
  } 
  
  }
  </code></pre>