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

New Post: VBScript ByRef arguments cannot seem to get to work.

$
0
0
Greetings!

By-reference arguments to VBScript functions are not currently supported. We'll use the work item you created to track this issue. Thanks for reporting it!

In the meantime, you can create a wrapper in VBScript that calls the target function and returns its output to the host without by-reference parameters. For example:
publicclass Holder<T> {
    public T Value;
}
And then:
engine.Execute(@"
    sub TestSubWrapper(holder)
        dim value
        value = holder.Value
        call TestSub(value)
        holder.Value = value
    end sub
");

var holder = new Holder<double> { Value = 10.0 };
engine.Script.TestSubWrapper(holder);
Console.WriteLine(holder.Value);
Thanks again, and good luck!

Viewing all articles
Browse latest Browse all 2297

Trending Articles



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