VB: possible to define an optional parameter in a sub?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2010
01:23 AM
02-01-2010
01:23 AM
VB: possible to define an optional parameter in a sub?
Hi all,
In VB it should be possible to declare a sub procedure with an optional parameter, e.g.:
Sub notify(ByVal company As String, Optional ByVal office As String = "QJZ")
I know that the 'As String' won't work but something like;
Sub notify(company, Optional office = "QJZ")
should work?!?
But this fails in TestComplete (7.52.678.7).
Must all parameteres in TestComplete be required?
Thank you!
Best regards
Kresten Bager
In VB it should be possible to declare a sub procedure with an optional parameter, e.g.:
Sub notify(ByVal company As String, Optional ByVal office As String = "QJZ")
I know that the 'As String' won't work but something like;
Sub notify(company, Optional office = "QJZ")
should work?!?
But this fails in TestComplete (7.52.678.7).
Must all parameteres in TestComplete be required?
Thank you!
Best regards
Kresten Bager
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2010
02:18 AM
02-01-2010
02:18 AM
Hi Kresten,
TC uses the standard Microsoft VBScript engine which doesn't support optional parameters.
TC uses the standard Microsoft VBScript engine which doesn't support optional parameters.
------
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-01-2010
02:20 AM
02-01-2010
02:20 AM
Hi Jared,
Ok, thank you.
Regards
Kresten
Ok, thank you.
Regards
Kresten
