Array Range Check Error

I’m having an issue with V15R4 Windows that makes no sense to me, and hoping someone can provide insight.

I am getting an array range check error on the following line:

If (Size of array(as_function)>=1)

This is a compiled application, so how does this type of error even exist for this line?

The details on the error are blank, it simply says:

Error when executing the method “Get Data Changes” at line #119
Array Range Check Error

Any one know what might result in this issue?

Best,

Steve

Hi Steve,

We had a similar problem in a compiled v15.2 application. We solved it by putting the result of Size of array in a variable and then we compared the variable.
This code produced the error from time to time in compiled mode:
for ($i;1;size of array(atNames))
.
.
.
end for

Since we changed the code to
$lSize:=Size of array(atNames)
for($i;1;$lSize)

end for
the error disappeared.
Really strange!

Regards,
Franco

Franco,

Interesting, I’ll give this a try, as I’m completely stumped on this one.

Thanks!!

Steve

Hi Steve,

I don’t know if it is the same issue, but in the past I have seen Size of array(myArray) return a very huge number in compiled app. Resulting in a range check error in the next lines accessing the elements of that array.
The reason was the array initialization code ARRAY WHATEVERTYPE(myArray;0) was never executed.

No problem interpreted, but unreliable results compiled.

It is not enough to create the COMPILER_… declaration methods. The initialization must actually be executed.

HTH
Koen

: Koen VAN HOOREWEGHE

It is not enough to create the COMPILER_… declaration methods. The
initialization must actually be executed.
That could be a feature request, IMHO. Seems strange that variables are ok for use after the fork and not the arrays.