Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Edited Issue: Calling a function with a parameter in JScriptEngine [56]

$
0
0
I initialize my engine with the following lines:

```
Dim engine As JScriptEngine
engine = New JScriptEngine(WindowsScriptEngineFlags.EnableDebugging)
engine.AddHostType("Console", GetType(Console))

```

I add the following script to the engine:

```
function Test(param) {
Console.WriteLine("Called Test with param: " + param);
}
```

When I call

```
engine.Script.Test(20)
```

It prints: "Called Test with param: undefined"

Does JScriptEngine not support calling internal functions with parameters?

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>