Opa ele gera o seguinte erro ao compilar [Error] Unit1.pas(40): Assignment to FOR-Loop variable 'sena' [Error] Unit1.pas(43): ')' expected but ';' found [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
pq este erro? > Se for pra não ter repetições, eu usaria TList ao invés de TStringList, e da seguinte maneira: > > procedure TForm1.BitBtn1Click(Sender: TObject); > var > sena: Integer; > Lista: TList; > Begin > Randomize; > ListBox1.Items.Clear; > Lista := TList.Create; > try > for sena := 1 to 15 do > begin > repeat > sena := Random(100) > until Lista.IndexOf(Pointer(sena)) = -1; > Lista.Add(Pointer(sena)); > ListBox1.Items.Add(sena); > end; > finally > Lista.Free; > end; > end;