I have the following code (for example) and I’m getting an error before I can run my script.
var journalList : XmlNodeList = XmlDoc.GetElementsByTagName("entry");
var journalEntries : Array = new Array();
for (N in journalList){
var journal : JournalEntry = new JournalEntry();
var children = N.ChildNodes;
for(var i = 0; i<children.Count;i++){
var childName : String = children[i].Name.ToString();
Debug.Log("childName: "+childName);
switch(childName){
case "id":
Debug.Log ("ID: ");
journal.JournalId(children[i].InnerText);
break;
}
}//end for i
journalEntries.push(journal);
}
and I get BCE0015: Node ‘__switch__314’ has not been correctly processed.
Now, if I take this switch, (or a similar switch) and move it outside of this for loop, everything compiles fine. Why does putting a switch inside of a for loop of this structure cause an error? If I change the structure of the for loop to not use the (N in journalList) structure, the script will compile fine. Is this a bug?