Question: Why nothing is drawn on my chart(Plotter) when I use block of if?

When I use block of 'if' in procedure Work I see empty graph. If there are no 'if' everything works properly

 

with(Maplets);
with(Elements);
with(Tools);
with(plots):
work := proc() local f, k, x0, y0, result, l;
l := Get(L::algebraic);
x0 := Get(X::algebraic);
y0 := Get(Y::algebraic);
result := subs(x = x0, l);
f := plot(l);
k := plots:-pointplot([x0, y0]);
plots[plots:-display]({f, k});

 

THESE BLOCK OF 'if'
if result = y0 then Set(res = "Belongs");
elif y0 < result then return Set(res = "Above");
elif result < y0 then return Set(res = "Below");
end if;


end proc;

 

mpt := Maplet(Window("Test", [[Plotter[f]()],
["Line eq", TextField[L]()],
["X ", TextField[X]()],
["Y ", TextField[Y]()],
["Result ", TextField[res](editable = false)],
[Button("Результат", Evaluate(f = 'work()')), Button("OK", Shutdown([res]))]]));


Display(mpt);

 

With block of 'if'

Without block of 'if'

Please Wait...