Hi all hi Charles
IS this Kind of function structure possible in oxygen?
Function factorial(x As Integer) As Integer
' This is a recursive function
' to find the factorial of an integer
If x = 1 Then
factorial = 1
Else
'factorial = x * factorial(x - 1)
return x * factorial(x-1)
End If
End Function
print factorial(2)
Dim num As Integer
num = 3
Print "The factorial of " + num + " is " ''+ str(factorial(num) )
Almost:
Function factorial(x As Integer) As Integer
' This is a recursive function
' to find the factorial of an integer
If x <= 1 Then
return 1
Else
'factorial = x * factorial(x - 1)
return x * factorial(x-1)
End If
End Function
print factorial(4) '24