for i:=strtoinT(edit1.text) to strtoint(edit2.text) do if ISPrime(i) then listbox1.Items.add(inttostr(i));
Yoksa Function :)
function ISPrime(Value:Integer):Boolean;
var
i,j:integer;
begin
i:=0;
for j:=1 to Value do if (Value mod j=0) then i:=i+1;
if i=2 then result:=True;
end;