Q&A

  • 어느것이 잘못된걸까요?
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

var

i,j: Integer;

indexCd : Integer;

tempCd : String;

begin

indexCd := ord(Key) - 96;// A가 65 - a가 97

for i := 0 to 4 do

for j := 0 to 9 do

if ( str_nm[i][j] = Key ) then

begin

if ((i*10 + j) >= 0) and ((i*10 + j) <= 9) then

tempCd := '0' + IntToStr(i*10 + j)

else

tempCd := IntToStr(i*10 + j);



TImage(FindComponent('image' + tempCd)).Picture.LoadFromFile('image'+ intToSTr(indexCd) + '.bmp');

end;

end;

를 click 으로 바꾸려하는데.....

procedure TForm1.input1Click(Sender: TObject);

var

i,j: Integer;

indexCd : Integer;

tempCd : String;

begin

indexCd := ord(strtoint(edit8.text)) - 96;// A가 65 - a가 97

for i := 0 to 4 do

for j := 0 to 9 do

if ( str_nm[i][j] = strtoint(edit8.text) ) then

begin

if ((i*10 + j) >= 0) and ((i*10 + j) <= 9) then

tempCd := '0' + IntToStr(i*10 + j)

else

tempCd := IntToStr(i*10 + j);



TImage(FindComponent('image' + tempCd)).Picture.LoadFromFile('image'+ intToSTr(indexCd) + '.bmp');

end;

end;



strtoint(edit8.text)이것이 잘못된거 같거든요... 한번 봐주시겠어요....

0  COMMENTS