VBScriptEngine - Use of functions with optional parameters #624
Replies: 1 comment 2 replies
-
Hi @DanielGerlach2,
ClearScript uses the C# algorithm for binding call signatures to methods, and although both C# and VB.NET support optional parameters, neither language supports sparse arguments – that is, positional argument lists with one or more "gaps". One way to make this work is to bypass the method binding phase by exposing ClearScript also supports an alternate method binding scheme based on reflection, enabled via Thanks! |
Beta Was this translation helpful? Give feedback.
-
Code is executed via the VBScriptEngine, which in turn is supposed to call a function with optional parameters.
e.g.
List("[Value1]",,1)
Definition of function:
Public Function List(Field as String, Optional Field2 as String = "", Optional Count as Integer = 0)
The following error is then output:
The best match for the overloaded List(string, string, int) method contains some invalid arguments.
However, if I specify the default values in the scritcode, the function call works
List("[Value1]","",1)
Is there a setting or option that needs to be set so that the call works correctly even without specifying the optional parameters?
Beta Was this translation helpful? Give feedback.
All reactions