Author Topic: Interesting C# syntax problem  (Read 169 times)

0 Members and 1 Guest are viewing this topic.

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2891
    • Paul Herber's website
Interesting C# syntax problem
« on: July 11, 2020, 12:18:41 PM »
While investigating a bug in some code for a Visio C# addon I eventually found the problem:
I had:
Code
  for (int i=0; i <- p1.RowCount[(short)section]-1; i++) 
instead of:
Code
  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 and applications for Visio -

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

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2891
    • Paul Herber's website
Electronic and Electrical engineering, business and software stencils and applications for Visio -

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