Array of string not working
<p>I use a simple array: contentHouseOne[] that contains strings. But in the Do/While loop it isn't working! It seems like the code don't understand that it's a string when a new object is to be created!? It works when I hardcode the string like I show below. Help is preciated! Thanks!</p>

<p>This isn't working:</p>

<pre><code>listHouseParts.Add(new HousePart(content, contentHouseOne[i], newPosition));
</code></pre>

<p>But this works:</p>

<pre><code> listHouseParts.Add(new HousePart(content, "100x100", newPosition));
</code></pre>

<p>EDIT:</p>

<p>Here are some code to declare arrays</p>

<pre><code>string[] contentHouseOne = new string[] { "ruta100x100Red", 
                                          "ruta100x100Grey", 
                                          "ruta100x100Green", 
                                          "ruta100x100Yellow", 
                                          "ruta100x100Blue" };

bool[,] occupiedPositions = new bool[500,500];
</code></pre>

<p>Here are some code to set all grid positions to false</p>

<pre><code>for (int i = 0; i &lt; gridCol; i++)
    for (int ii = 0; ii &lt; gridRow; ii++)
        occupiedPositions[i, ii] = false;
</code></pre>

<p>And finally here are the code that I have the problem</p>

<pre><code>int i = 0;
do
{
    Vector2 newPosition = NewRandomPosition;
    if (occupiedPositions[(int)newPosition.X, (int)newPosition.Y] == false)
    {
        listHouseParts.Add(new HousePart(content, 
                                         contentHouseOne[i], newPosition));
        occupiedPositions[(int)newPosition.X, (int)newPosition.Y] = true;
        i++;
    }
}
while (i &lt;= 5);
</code></pre>
