Lee,

I just converted your UDF to VBS and was utterly shocked when I got exactly the same error !!! Would have bet the farm that this was a bug.

C:\t.vbs(8, 2) Microsoft VBScript runtime error: Out of stack space: 'Exp'

Heres the code:

code:
 
WScript.Echo Exp(5,5)

Function Exp(Base, Power)

' Returns a base value raised to the specified power

Exp = IIF(Power = 0, 1, Exp(Base, Power - 1) * Base)

' If Power = 0 Then
' Exp = 1
' Else
' Exp = Exp(Base, Power - 1) * Base
' End If

End Function

There must be more going on here than meets the eye !!!

-Shawn

[ 08. January 2003, 19:02: Message edited by: Shawn ]