开发者

Code cutting off string after runs many times

开发者 https://www.devze.com 2023-01-29 03:06 出处:网络
This code runs in a loop. After the 38th time it runs, the string that gets printed to the text file cuts off immediately after the second \"M\", doesn\'t even print the comma, and then stops printing

This code runs in a loop. After the 38th time it runs, the string that gets printed to the text file cuts off immediately after the second "M", doesn't even print the comma, and then stops printing everything and ends.

What could be the cause of this?

private static void LogPayment(CDefeasancePayment paymentToLog, System.IO.StreamWriter outfile)
{
    string li开发者_Go百科ne = "AddDefeasancePayment(DateTime.Parse(\"" + paymentToLog.PaymentDate.ToShortDateString() +
                  "\"), " + paymentToLog.Interest +
                  "M, " + paymentToLog.Principal + "M, DateTime.Parse(\"" +
                  paymentToLog.StripDate.ToShortDateString() + "\"), " + paymentToLog.StripPrice +
                  "M);\n";
    outfile.Write(line);
}


Make sure you have flushed your outfile buffer.

0

精彩评论

暂无评论...
验证码 换一张
取 消