DUPLICATE: Array subscript out of range while run in explorer editor

Moderator comment: Instead of posting to forum each and every question press F1 in the program. All errors are explained in detail in the help file
Error 10. Subscript out of range. You must not access array elements outside 0..(BarCount-1) range . There is also plenty of additional material in the Knowledge Base: AmiBroker Knowledge Base » Do NOT make assumptions on number of bars

Hi..
Please find the below code

_SECTION_BEGIN("creating dynamic array");
array=0;
i=0;
while (i<10)
{
array[i]=i;
i=i+1;
}
AddColumn(array,"array values");
_SECTION_END();

When i run the code in the editor it is working fine as expected. But the same code if i run through explorer getting the error as "Array subscript out of range.You must not access array elements outside o barcount-1 range. you attempt to access non existing of 7th element of array." Please let me know the issue. you can reproduce the issue just to run the program in explorer window.
Please find the attachment for more details.

This topic is duplicate of:

Please SEARCH the forum BEFORE posting duplicates.

2 posts were merged into an existing topic: Array Subscript out of Range Error