mr_unreliable
Wed Sep 13 16:27:27 CDT 2006
hi frameexpert,
I am curious about the language you are using in "another application".
The reason is that just about every language I can think of (except
maybe assembly language) has its own math functions. And, the math
functions you get with vbScript are VERY minimal (the trig functions,
plus exp and log).
If you insist on using vbscript for math, you could write your own
COM object in vbScript. Go to microsoft's scripting site:
http://msdn.microsoft.com/scripting/
and look up "Windows Script Components" (alias "scriptlets). You can
write a scriptlet to expose any math function available in vbScript,
register it, and then access it like any other COM object.
For example, to wrap the "sin" function:
Public Function mySinFunction(vRadians)
' (meta code: if vRadians is not numeric, throw error)
mySinFunction = Sin(vRadians) ' set return value
End Function
Then to use it:
Set oMath = CreateObject("myMathComponent.wsc")
CalcSine = oMath.mySinFunction(vAngle) ' in radians
cheers, jw
____________________________________________________________
You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)
frameexpert wrote:
> Hi am able to use VBScript.RegExp as an object in another application,
> which allows me to use regular expressions in that application. I would
> like to do something similar for math functions. Is there a way to use
> VBScript as a COM object so I can access its math functions? Thank you
> very much.
>
> Rick Quatro
>