The object has no method named '<Methodname>' that matches the specified arguments #721
DanielGerlach2
started this conversation in
General
Replies: 1 comment
-
|
Hi @DanielGerlach2, .NET has no implicit integer-to-string conversion. However, you can enable the desired behavior by defining an overload: Public Sub Send(Key As Integer, Optional Caption As String = "Dialogcaption")
Send(CStr(Key), Caption)
End SubOr, you could define Public Module AppExtensions
<Extension>
Public Sub Send(pApp As App, Key As Object, Optional Caption As String = "Dialogcaption")
pApp.Send(CStr(Key), Caption)
End Sub
End ModuleAnd then: engine.AddHostType(GetType(AppExtensions))Good luck! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Unfortunately, I have to get back in touch with you again. 😲
When using ClearScript, I noticed that the implicit conversion of parameters does not work as expected.
I have a function with the following signature:
Public Sub Send(Key As String)When I call this function using the scriptengine with an integer parameter, I get the following error:
The object has no method named 'Send' that matches the specified arguments.
The problem can be reproduced using the following code.
The goal is to call the function and perform an implicit conversion from integer to string.
Beta Was this translation helpful? Give feedback.
All reactions