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

New Post: Weird Parameter Passing Behavior

$
0
0
Ok, last question two questions, Mr. ClearScript.

Here is my current scenario,
  1. I run a script which returns a string and I assign it to an object.
  2. The object returns the V8ScriptItem.
  3. Whenever I try to reference the object, for its value, it tries to invoke it as a script (or so it seems).
Basic line of code I am using is below...
c is an object but the function is returning a string.
s1 is a string, CType is VBs way of casing, (String)
c = JSEngine.Script.getChunkJSON(chunkNum)
s1 = CType(c, String)
The second line errors. Screenshot of the error and call stack can be found below.
http://puu.sh/aDTlS/291299d450.png
http://puu.sh/aDTir/407d48e142.png

Any advice, or another way I should reference the result so it is seen as a value instead of a script to execute?


Second question, should be a lot simpler... Could you show me show a cross between the Script.Method(args) and Engine.Evaluate("Code") would look like? My hope is to have a function that accepts a method name as a parameter and arguments as a second one like NeoLua used to.

Engine.Evaluate(MethodName,Args[]);

Thanks so much for your help and your continued support. BTW, the first fix works great.
-JC

Viewing all articles
Browse latest Browse all 2297

Trending Articles



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