Ask a Question

VB: possible to define an optional parameter in a sub?

krestenbager
Occasional Contributor

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
2 REPLIES 2
YMinaev
Staff

Hi Kresten,



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. ⬇️⬇️⬇️
krestenbager
Occasional Contributor

Hi Jared,



Ok, thank you.



Regards

Kresten
cancel
Showing results for 
Search instead for 
Did you mean: