Попытка изменить высоту формы. В форме я пытаюсь изменить это дает мне ошибку:Ошибка при попытке изменить высоту формы
"Access violation at address 005B9963 in module 'M1Project.exe. Read of address 0000005C."
В других формах я могу изменить высоту хорошо, это просто такая форма. Кто-нибудь знает, почему эта ошибка происходит? Вот код:
procedure TExamQuestions.RandomQuestionButtonClick(Sender: TObject);
var
gif:TgifImage;
filelocation,temp:string;
i,x,cycle,questionid,length:integer;
questionpool: array [0..81] of integer;
begin
Randomize;
cycle:=random(80)+1;
questionid:= cycle mod x;
currentquestion:=questionpool[questionID];
temp:=inttostr(currentquestion);
if temp='0' then
temp:=inttostr(questionpool[x]);
gif:=TgifImage.Create;
loginmenu.ADOQuery1.SQL.Clear;
loginmenu.ADOQuery1.SQL.Add('SELECT question from examquestions where questionID='+temp+'');
loginmenu.ADOQuery1.Active:=true;
filelocation:=loginmenu.datasource1.DataSet.FieldByName('Question').AsString;
filelocation:=('O:\Subjects\Computing\Year 13 EXEs\DButcher\A2 bant\Project = (\Program\Resources\List\'+filelocation);
gif.loadfromfile(filelocation);
length:=gif.Height;
ExamQuestionPicutre.Height:=length;
background.ClientHeight:=length;
ExamQuestionPicutre.Picture.assign(gif);
examquestions.Height:=length;
end;
Вы также должны рассмотреть другое имя для локальной переменной «длина», так как «Длина» также является именем внутренней функции. –