//int x = m_dibs.Length;
for (int i = 0; i < m_dibs.Length; i++)
Here is my X# translation:
x := self:m_dibs.Length
for i := 0 upto self:m_dibs.Length
In the C#, since the length is 0 when the class is first instantiated, the code inside the for next loop doesn't run. But in the X#, the line inside the for next loop get executed, which resulted in index out of range error. I also use "to" instead of "upto".
I know I can prevent this by first checking if the length is > 0 before running the for next loop or perhaps initialize i := 1.
I am using Core dialect. "Use Zero Base Arrays" is false at first. I also tried setting to true. Same result.
Is there a similar code for X#?. I thought the index in Core dialect is zero base like C#.