PDA

View Full Version : تغییر سایز آرایه دینامیک



mossaferin
چهارشنبه 29 مهر 1388, 15:43 عصر
سلام

من توی برنامم یه رکورد به این شکل تعریف کردم



type
TNewPosition=record
plate1:array of array of tdevice;
plate2:array of array of tdevice;
plate3:array of array of tdevice;
plate4:array of array of tdevice;
plate5:array of array of tdevice;
plate6:array of array of tdevice;
ambient:array of tdevice;
end;
PTNewPosition=^TNewPosition;
و به این شکل هم استفاده کردم



var
newsensorpos:PTNewPosition;
begin
new(newsensorpos);



setlength(newsensorpos^.plate1,form1.config.P1Widt h,form1.config.P1Height);
setlength(newsensorpos^.plate2,form1.config.P2Widt h,form1.config.P2Height);
setlength(newsensorpos^.plate3,form1.config.P3Widt h,form1.config.P3Height);
setlength(newsensorpos^.plate4,form1.config.P4Widt h,form1.config.P4Height);
setlength(newsensorpos^.plate5,form1.config.P5Widt h,form1.config.P5Height);
setlength(newsensorpos^.plate6,form1.config.P6Widt h,form1.config.P6Height);
setlength(newsensorpos^.ambient,form1.config.Ambie nt);
.
.
.
با وجود تعریف و تنظیم طول آرایه ها گاهی اوقات به صورت نا خواسته طول آرایه ها تغییر میکنه و 0 میشه که نمیدونم چرا و چه جوری میشه جلوگیری کرد

ممنون میشم اگه کسی تجربه ای داره یا راه حل یا شاید اصلا روش من اشتباه باشه ...

با تشکر

mossaferin
پنج شنبه 30 مهر 1388, 20:17 عصر
هیچکس ، هیچ نظری نداره ؟