Sieve of Eratosthenes: Difference between revisions
Content deleted Content added
m →{{header|Free Pascal}}: to avoid error when list of primes is empty |
|||
Line 8,256: | Line 8,256: | ||
I: DWord; |
I: DWord; |
||
begin |
begin |
||
if aList.Size <> 0 then begin |
|||
if aList.Size > 1 then |
|||
for I := 0 to aList.Size - 2 do |
|||
Write(aList[I], ', '); |
|||
WriteLn(aList[aList.Size - 1]); |
|||
end; |
|||
aList.Free; |
aList.Free; |
||
end; |
end; |
||
Line 8,397: | Line 8,400: | ||
for I := 0 to Length(aList) - 2 do |
for I := 0 to Length(aList) - 2 do |
||
Write(aList[I], ', '); |
Write(aList[I], ', '); |
||
if aList <> nil then |
|||
WriteLn(aList[High(aList)]); |
|||
end; |
end; |
||
begin |
begin |