Interesting C# syntax problem

Started by Paul Herber, July 11, 2020, 05:18:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Paul Herber

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.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/