offset inside array of records

Discuss about beta versions of mikroPascal compiler.
Post Reply
Author
Message
jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

offset inside array of records

#1 Post by jpc » 18 Feb 2007 12:31

think i have reported this once before , cannot find it right now so here a new thread , the following code shows incorrect behaviour (until now only cheked in debugger)

Code: Select all

program array_of_record_problem;

const bufsize : word = 30;
      Crlf        : Array[3] Of Byte = (13,10,0);

type irectype = record
                  recbuf  : array[bufsize] of byte;
                  head ,
                  tail,
                  match,
                  index,
                  state,
                  stat    : byte;
                  delimiter : string[6];
                  bittime : word;
                end;

var single  : irectype;
    irec    : array[0..12] of irectype;
    testarr : array[300] of byte;

procedure init;
var i : word;
begin
  single.delimiter := crlf;
  irec[3].stat := 123;
  for i := 0 to 12 do irec[i].delimiter := crlf; <<<<<<<<<<<<<<<< problem
  for i := 0 to 290 do testarr[i] := 69;
end;

begin
  memset(@single,33,sizeof(single));
  init;
  while true do
  begin
  end;
end.

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

Re: offset inside array of records

#2 Post by zristic » 19 Feb 2007 13:17

Fixed. Thanks.

Post Reply

Return to “mikroPascal Beta testing”