Ok, so I'm working on a script to find the factors of a given number and then print them out. Everything seems to work except that it always leaves out a couple factors. If anyone can help then thanks 
SCAR Code:
program New;
function IsDecimal(x, y:integer): Boolean;
var z: integer;
begin
z := x / y;
if x mod y = 0 then
begin
Result := True;
end else
Result := False;
end;
procedure FindFactors(x:integer);
var
i, z, h, m:integer;
Factors: array of Integer;
begin
for i:=1 to x do
begin
z := i;
if IsDecimal(x, z) then
begin
h := Length(Factors);
m := h + 1;
SetLength(Factors, m);
Factors[High(Factors)] := z;
i := i + 1;
end;
end;
for i:=0 to High(Factors) do
begin
WriteLn(Factors[i]);
end;
end;
begin
FindFactors(100);
end.