Subject | Can I rely on array bounds definition |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2004-05-06T10:33:13Z |
Hi, All!
In an inherited program I've found this code:
/*It would appear that arrays are 0 based even if declared as 1 based
so size = itemsize * (upperbound + 1)
NOT itemsize * (upperbound - lowerbound + 1) */
for (x = 0; x < desc.array_desc_dimensions; x++)
TotalSize *= (desc.array_desc_bounds[x].array_bound_upper) + 1;
What does it mean? Something is wrong with array bounds in some IB
versions or something was wrong with previous developer's brain?
SY, Dimitry Sibiryakov.
In an inherited program I've found this code:
/*It would appear that arrays are 0 based even if declared as 1 based
so size = itemsize * (upperbound + 1)
NOT itemsize * (upperbound - lowerbound + 1) */
for (x = 0; x < desc.array_desc_dimensions; x++)
TotalSize *= (desc.array_desc_bounds[x].array_bound_upper) + 1;
What does it mean? Something is wrong with array bounds in some IB
versions or something was wrong with previous developer's brain?
SY, Dimitry Sibiryakov.