Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2006.04.02;
Скачать: [xml.tar.bz2];

Вниз

Amazing bug ?   Найти похожие ветки 

 
Dodfr   (2005-08-11 12:41) [0]

In this code, when I do form1.form.left:=PosX[0]; the PosX[1] changes and get PosX[0] value ?!? how is it possible as I do not write any value inside it after filling array once ???

const
 MaxFormView=4;

type
 _INISettings = record
   OnTop:integer;
   FontName:string;
   FontSize:integer;
   PosX:array[0..MaxFormView] of integer;
   PosY:array[0..MaxFormView] of integer;
 end;
 INISettings = _INISettings;
 PINISettings = ^INISettings;

var
 Pini:INISettings;

procedure TForm1.KOLForm1FormCreate(Sender: PObj);
var
 i:integer;

begin
   for i:=0 to MaxFormView do
   begin
     Pini.PosX[i]:=str2int(ini.ReadString(ConstSettings,"PosX"+int2str(i),"0"));
     Pini.PosY[i]:=str2int(ini.ReadString(ConstSettings,"PosY"+int2str(i),"0"));
   end;

   Form1.form.left:=Pini.PosX[0];
   // now PosX[1]=PosX[0] !!!
   Form1.form.Top:=Pini.PosY[0];
   // now PosY[1]=PosY[0] !!!

  If I copy/past the for/next and .left/top block a second time just below this code, array are refilled and this time they don"t change after the form.left end form.top !!!


 
Dodfr   (2005-08-11 12:47) [1]

If I change location of PosX and PosY in record definition it do not help.

If I simply fill arrays with this, it do not help :

   for i:=0 to MaxFormView do
   begin
     Pini.PosX[i]:=i;
     Pini.PosY[i]:=i;
   end;

If I do some i2:=Pini.PosX[0] there is no bug.

How the form1.form.left:=PosX[0] could copy value of PosX[0] inside PosX[1] ???



Страницы: 1 вся ветка

Форум: "KOL";
Текущий архив: 2006.04.02;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.44 MB
Время: 0.035 c
2-1142414436
PoetOfDelphi
2006-03-15 12:20
2006.04.02
Проверка поля типа TNotifyEvent


1-1141243953
g-l-u-k
2006-03-01 23:12
2006.04.02
Криптование процедуры в Delphi


2-1141726763
nap<>
2006-03-07 13:19
2006.04.02
UPX


15-1141884390
Ega23
2006-03-09 09:06
2006.04.02
С Днём рождения! 9 марта


15-1141991242
Mystic
2006-03-10 14:47
2006.04.02
Давно веток про магию не было...





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский