How to convert Jscript null into dotNet Null
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2010
06:50 AM
02-02-2010
06:50 AM
How to convert Jscript null into dotNet Null
Hi. I have a script wrote on Jscript. I trying to call a method from C# application. I must to set one of the parameters equal "null", but i get a message: "Mismatch types".
The reason is: "Jscript differs from dotNet Null"
How to convert Jscript null into dotNet Null ?
Thanks.
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2010
07:21 PM
02-02-2010
07:21 PM
Hi Viktor,
Can you post here your function's declaration (just its name with parameters) and let us know which of them should be Null?
Can you post here your function's declaration (just its name with parameters) and let us know which of them should be Null?
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2010
10:21 PM
02-02-2010
10:21 PM
Hello, thanks for reply!
CompareStrings (string str1, string str2, ICompareOptionsProvider options)
I have to pass null in the parameter "options"
the call in C# looks like
CompareStrings(srtVar1, strVar2, null).
In the TestComplete script I have wrote the function call like this
CompareStrings (string str1, string str2, ICompareOptionsProvider options)
I have to pass null in the parameter "options"
the call in C# looks like
CompareStrings(srtVar1, strVar2, null).
In the TestComplete script I have wrote the function call like this
CompareStrings(dotNET.System.String.Copy(gSQLEditor.Text), dotNET.System.String.Copy(ScriptEtalon), null)
But as I have read in the JScript reference, null keyword represents a structure that cannot be converted implicitly.
Please help!!!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2010
07:12 PM
02-03-2010
07:12 PM
Hi Viktor,
You need to find a method (in your application or in some assembly) which returns Null and use this method's return value. This seems to be the only way to get the .NET Null value in scripts. For example, you can implement a method which will return Null in your application's main form class and, after that, use this method in scripts.
You need to find a method (in your application or in some assembly) which returns Null and use this method's return value. This seems to be the only way to get the .NET Null value in scripts. For example, you can implement a method which will return Null in your application's main form class and, after that, use this method in scripts.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
