mardi 22 janvier 2019

Adding an integer into a labels name

I have a 8x8 grid of labels and I need to randomly choose some of them (their names are label1..label64) and change their captions to ('X'). Can someone suggest a method how to do that? p. s. I am using Lazarus

randomize;
for i:=0 to StrToInt(EditMS. Text) do
begin
x:=random(63)+1;
Label(x).caption:=('X');
end;




Aucun commentaire:

Enregistrer un commentaire