Using of CurrencyWrapper resolve this issue.
↧
New Post: Decimal values problems
↧
New Post: Decimal values problems
Hi Igor,
Sure. One thing you could do is use a host method to operate on decimal values:
Another possibility might be to use a host method to cast decimal values to a type that VBScript can deal with:
Good luck!
Can you give me example?
Sure. One thing you could do is use a host method to operate on decimal values:
scripter.Script.add = new Func<decimal, decimal, decimal>((a, b) => a + b); Console.WriteLine(scripter.Evaluate("add(num1, num2)"));
scripter.Script.toDouble = new Func<decimal, double>(value => (double)value); Console.WriteLine(scripter.Evaluate("toDouble(num1) + toDouble(num2)"));
↧
↧
New Post: Problem with nullable property of object
Hi Igor,
You have to use the
You have to use the
IsNull
function in this case:function Test
if IsNull(Class1.Class2) then
Test = true
else
Test = false
end if
end function
Thanks!↧
New Post: Decimal values problems
It's not solution for our legacy application, we can't fix all customer scripts.
Anyway thanks a lot.
Anyway thanks a lot.
↧
New Post: Problem with nullable property of object
That break compatibility with legacy application. We can't change client scripts.
↧
↧
New Post: Decimal values problems
What VBScript data type do the scripts use for which you're trying to provide decimal values? Is it
currency
?↧
New Post: Problem with nullable property of object
Understood. Unfortunately there seems to be no way to marshal
nothing
into the script engine. That is, there's no value we can return from the host that VBScript will interpret as nothing
. We can marshal in null
and empty
, but not nothing
. And marshalling nothing
out of VBScript doesn't work; the result on the host is null
.↧
New Post: Problem with nullable property of object
Try use DispatchWrapper.
↧
New Post: Decimal values problems
Yes, it's a currency
↧
↧
New Post: Problem with nullable property of object
You're absolutely right! A value of
We'll be happy to add
Thanks again!
new DispatchWrapper(null)
is picked up as nothing
on the VBScript side. Thank you!We'll be happy to add
null
<-> nothing
marshalling to ClearScript, but it'll have to be optional to avoid breaking existing code. A new engine flag seems like a sensible approach.Thanks again!
↧
New Post: Decimal values problems
We'll add
decimal
<-> currency
marshalling to ClearScript. Thanks!↧
New Post: Problem with nullable property of object
Thanks. Is there nightly builds of the ClearScript?
↧
Source code checked in, #7df5fa298b6449386dc0beace2f87f789118b476
Added null and decimal marshaling options to WindowsScriptEngine.
↧
↧
New Post: Problem with nullable property of object
Hi Igor,
No, but we just posted a source code update that includes the new marshaling options. If you get a chance, please give them a try and let us know if they work for you.
Thanks again!
Is there nightly builds of the ClearScript?
No, but we just posted a source code update that includes the new marshaling options. If you get a chance, please give them a try and let us know if they work for you.
Thanks again!
↧
New Post: Problem with nullable property of object
Hi,
It's work. Thanks a lot.
If you have some progress with cloning of script engine, please update the source code. I use with source code of script engine and have modified version of the ClearScript.
It's work. Thanks a lot.
If you have some progress with cloning of script engine, please update the source code. I use with source code of script engine and have modified version of the ClearScript.
↧
New Post: Parent-child script relation
Small question about setting global variables.
Suppose I have following script that has account variable.
Thanks
Suppose I have following script that has account variable.
dim account
function GetAccountName()
GetAccountName = account.Name;
end function
What is "true" way set this variable by reference?Thanks
↧
New Post: Getting JS exception
Hello!
Currently there's no plan beyond adding a script-callable
Thanks for your input!
Is there any plan to have more seamless exception handling between .NET and JS, even for V8 only?
Currently there's no plan beyond adding a script-callable
tryCatch()
function on the host side. Generally we favor keeping the engine APIs uniform, but we agree that this may be worth doing anyway, so we've put it on our long-term to-do list.Thanks for your input!
↧
↧
New Post: Parent-child script relation
Greetings!
Sorry, please clarify. Are you asking how to set the
What is "true" way set this variable by reference?
Sorry, please clarify. Are you asking how to set the
account
variable from the host?↧
New Post: Parent-child script relation
Yes, that should be similar to
set account = hostObject
but notaccount = hostObject
↧
New Post: Problem dealing with arrays in VBScript
Hi,
I have following simple code. It works fine with MSScriptControl, but using VBScriptEngine it doesen't work:
I'm new to clearscript. What i#m doing wrong?
Best regards
nbgedo
I have following simple code. It works fine with MSScriptControl, but using VBScriptEngine it doesen't work:
private void btnExecuteScript_Click(object sender, EventArgs e)
{
try
{
using (ScriptEngine engine = new VBScriptEngine())
{
object[] array = new object[] { 1, 2, 3 };
engine.AddHostObject("arr", array);
var value = (string)engine.Evaluate("arr(1) = 1");
MessageBox.Show(value.ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Error message is: "Object does not support the requested invocation operation"I'm new to clearscript. What i#m doing wrong?
Best regards
nbgedo
↧