if、函数、递归 总是报错!

if、函数、递归 老是报错!!!function func(x:integer):integerbeginif(x0) thenresult 0elseresult x*func

if、函数、递归 老是报错!!!


function func(x:integer):integer;
begin
     if(x=0) then
          result 0
     else
          result x*func(x-1);
end;

错在哪了呢?
[解决办法]
首先是语法错误 result 0 应为result:=0,依此类推。