-On the first if, in the function, you should be checking for n=0. The reason is when n=1 the recursive call will be (n-1) which will be equal to 0. At that point the if condition will return 1.
-In the original call to the function you need to do something with the result. In the following example I chose to print the result.
-In DB, applications close if you do not have a loop or a wait key command.
try this:
rem **** Recursion example to Calculate Factorials
print fact(4)
wait key
function fact(number)
if number=0
result=1
else
result= number * fact(number-1)
endif
endfunction result