C#
private System.IntPtr[] m_dibs;
or
X#
private m_dibs as IntPtr[]
In the constructor for the class:
m_dibs = new System.IntPtr[0];
or
m_dibs := IntPtr[]{0}
Here is my C# sample code:
Code: Select all
//int x = m_dibs.Length;
for (int i = 0; i < m_dibs.Length; i++)
{
EZTwain.DIB_Free(m_dibs[i]);
}
Code: Select all
x := self:m_dibs.Length
for i := 0 upto self:m_dibs.Length
EZTwain.DIB_Free(self:m_dibs[i])
next
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#.
Thanks,
Boonnam