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

New Post: Long/Int64 .NET Data types

0
0
I'm having some trouble passing large numbers from .NET to the JScriptEngine. Here is what I'm trying to do:
        JScriptEngine engine = new JScriptEngine();

        engine.AddHostObject( "bigNumber", (long)1400000000000 );
        var result = engine.Evaluate( "'BigNumber: ' + bigNumber" );

        Console.WriteLine( "Result: " + result.ToString() );
I'm getting an error on the AddHostObject call. Is it possible to pass long/Int64 data types from .NET to the JScript engine?

Thanks,

Jamin

Viewing all articles
Browse latest Browse all 2297