...
for (var index=0; index < ENCOUNTERS.Count; index++) {
var encounter = ENCOUNTERS.GetEncounter(index);
var encounterDate = encounter.#EncounterDate;
var encounterName = encounter.#IntervalName;
var variable1value = encounter.#Variable1;
var variable2value = encounter.#Variable2;
Output.Write("<tr><td>" + encounterDate + "</td>");
Output.Write("<td>" + encounterName + "</td>");
Output.Write("<td>" + variable1value + "</td>");
Output.Write("<td>" + variable2value + "</td></tr>");
}
Output.Write("</table>");
...