While investigating a bug in some code for a Visio C# addon I eventually found the problem:
I had:
for (int i=0; i <- p1.RowCount[(short)section]-1; i++)
instead of:
for (int i=0; i <= p1.RowCount[(short)section]-1; i++)
I would have thought that the space between the '-' and p1 would give an error. Obviously not.
Some interesting responses:
https://stackoverflow.com/questions/62865675/c-sharp-for-loop-syntax-query-why-does-this-compile?noredirect=1#62865862 (https://stackoverflow.com/questions/62865675/c-sharp-for-loop-syntax-query-why-does-this-compile?noredirect=1#62865862)