Closed IrunguMunene closed 1 year ago
Hi @IrunguMunene,
I tried to execute the following code but the results of the Year function are wrong.
The problem is with the VBScript code [Birth Date] = 01/01/1990
, It sets the variable to the numeric result of dividing 1 by 1990. Try this instead: [Birth Date] = CDate("01/01/1990")
.
I want to declare my own functions using VBScript in ClearScript and call them from other snippets. Is this possible?'
Sure, as long as you use the same engine to define your functions and run those snippets.
Good luck!
Thanks a lot.
``Hi,
I have an app that receives vbscript snippets that should be executed and return values. Most of the snippets deal with dates, but also numbers and strings. I tried to execute the following code but the results of the Year function are wrong. How to deal with dates in VBScript while using ClearScript?
Secondly, I want to declare my own functions using VBScript in ClearScript and call them from other snippets. Is this possible?
`using (VBScriptEngine scriptEngine = new VBScriptEngine(NullSyncInvoker.Instance)) { scriptEngine.HostWindow = new HostWindow();