I have the following code to write to a file, taken directly from MSDN, the file writes to the NT 6.5 folder, and it works just fine:
string path = Cbi.Core.UserDataDir.ToString() + 17Closes.inp"; FileInfo fi1 = new FileInfo(path);
if (!fi1.Exists)
{
//Create a file to write to.
using (StreamWriter sw = fi1.CreateText())
{
sw.WriteLine("Hello");
sw.WriteLine("And");
sw.WriteLine("Welcome");
sw.Close(); Print("Wrote a Line");
}
}
If I add some code just before that, a "loop" designed to take a sequence of Close periods in order to average them, for example:
COUNTER = 17; AI_index = 0; AVERAGE = 0; FIRST_ROUND = 0;
LOADER:
if(FIRST_ROUND == 0)
{
value = Close[AI_index];
INPUTS.Set(AI_index, value);
AVERAGE += INPUTS[AI_index];
} //FIRST_ROUND is 0
AI_index += 1; if(AI_index < COUNTER){goto LOADER;}
Print( "0: " + INPUTS[0]); Print( "1: " + INPUTS[1]);
...etc to INPUTS[16]
Suddenly everything changes. The previous output file does not get created, and the Output Window does not show the "Print" commands. Obviously there is a problem being caused by the "looping" code, but I have no idea what it is...seperately both sets of code work perfectly, combined not at all...why? Any ideas appreciated.

Comment