Bug in MikroPascal when using interger arrays

General discussion on mikroElektronika website & forums.
Post Reply
Author
Message
johnthefossil
Posts: 2
Joined: 17 Oct 2005 22:24
Location: South Africa

Bug in MikroPascal when using interger arrays

#1 Post by johnthefossil » 16 Dec 2005 08:26

Please help! :(

I am using MikroPascal v3.2.0.0 and the 16f877A.
The program I'm developing makes use of arrays. In attempting to execute my program I got very starnge results which led me to using the debugger. Here I found that the complier appears to mis-handle the allocation of a variable when assigning it to an array element. This however only occurs when the variable's value is <=255.

If one runs the following piece of code and views the contents of the array 'codes_table', the error is evident.

I'd really appreciate some help as I really need to use arrays!
Thanks
John


program test2;

var

codes_table : array[16] of integer;

begin
codes_table[0] := 3133;
codes_table[1] := 255;
codes_table[2] := 3313;
codes_table[3] := 3322;
codes_table[4] := 3331;
codes_table[5] := 331;
codes_table[6] := 333;
codes_table[7] := 256;
codes_table[8] := 3033;
codes_table[9] := 3003;
codes_table[10] := 3303;
codes_table[11] := 3300;
codes_table[12] := 3330;
codes_table[13] := 1330;
codes_table[14] := 1333;
codes_table[15] := 2233;

end.

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: Bug in MikroPascal when using interger arrays

#2 Post by zristic » 16 Dec 2005 11:34

Oooops :oops:

This will help:

Code: Select all

 codes_table[1] := integer(255);
The debugger will still lie, but the code will execute fine.

We will fix this. :oops: :oops:

Post Reply

Return to “Website & Forums General Discussion”