I should mention I am using Delphi 6 update 2

 

-----Original Message-----
From: Jason Coley
Sent: Wednesday, 5 February 2003 4:13 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Dynamic arrays

 

Hi there,

 

I have a record structure say

 

 

TFrames = record

            Desc:                shortstring;

            Side, top, width, height:  Integer;

            Use:                 Boolean;

End;

 

TImages = record

            Path:                shortstring;

            Side, top, width, height:  Integer;

            LockAspect:      Boolean;

            Use:                 Boolean;

End;

 

Trec = record

            Desc:                shortstring;

            I:                      Integer;

            Frames:            array of TFrame;

            Images:             array of TImages;

End;

 

Now when I resize the frames or images I use

            SetLength(Frames, Length(Frames) + 1);

            SetLength(Images, Length(Images) + 1);

 

Now this seems to work fine, except, if I have frames and then add a frame, sometimes the images gets corrupted, like if I had 5 images [0..4] and do a resize to Frames sometimes a images[2] will be duplicated to position 2 and 3, really weird, anyone had any problems with dynamic arrays like this?

 

Jay

 

Reply via email to