# Question:Can anyone tell me what is causing this error and how I can solve it?

## Question:Can anyone tell me what is causing this error and how I can solve it?

Maple 2015

Hi everyone! I was writing this code for an interactive component, when I stumbled into a problem that I couldn't solve...

Here is the code.

use DocumentTools in
if type(Do(%NIniziale), posint) then
if Do(%NIterazioni)<=100 then
if type(Do(%NIterazioni), posint) then
Do(%E="Valid Values!");
Even:=Do(%Pari);
Odd:=Do(%Dispari);
Iterazioni:=proc (N, i)
local m, n;
n:=N;
for m from 1 to i do
if type(n, even) = true then
n := Even;
else
n := Odd;
end if;
end do;
return (SetCellFormula("Risultati", i, 1, eval(n)));
end proc;
ix:=Do(eval(%NIterazioni));
Nx:=Do(eval(%NIniziale));
seq(Iterazioni(Nx,y),y=1..eval(ix));
if Do(%NIterazioni)<100 then
seq(SetCellFormula("Risultati", x, 1, "//"), x=1+ix..100);
end if;
else
Do(%E="Inavalid Values");
seq(SetCellFormula("Risultati", x, 1, "ERROR"), x=1..100);
end if;
else
Do(%E="Invalid Values");
seq(SetCellFormula("Risultati", x, 1, "ERROR"), x=1..100);
end if;
else
Do(%E="Invalid Values");
seq(SetCellFormula("Risultati", x, 1, "ERROR"), x=1..100);
end if;
end use;

Now this are what the names stands for:

%Pari is a math conainer in which there is a function of n that is to be used when n is even;

%Dispari is a math conainer in which there is a function of n that is to be used when n is odd;

"Risultati" is the name of a spreadsheet on which the results will be displayed;

%NIterazioni is a math conainer in which there is a posint that indicates how many times the procedure is to be iterated;

%NIniziale is a math conainer in which there is the starting number (another posint) to which on which the procedure will operate;

%E is a text area that will signal the validity of the input.

What I wanted to do was a procedure that reiterated two function on a given number a given amount of times and returned the result of every passage, however, when computing, it returns the function in n and not the final numbers. 