By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,550 Members | 908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,550 IT Pros & Developers. It's quick & easy.

How to pass an optional parameter along with required parameters in vb.net console?

Malathi
P: 31
Hi,

I created a console app (exe) which takes 3 inputs - 2 are mandatory and 1 is optional. Based on the completion of the exe, it returns 0 or 1 to indicate success or failure. Concept of my code is
Expand|Select|Wrap|Line Numbers
  1.     Public Function Main(ByVal CmdArgs() As String) As Integer
  2. ....
  3. If success then environment.exit =1
  4. return environment.exit
  5. else 
  6. environment.exit = 0
  7. return environment.exit
  8. end if
  9. ...
  10. end function
  11.  
This works perfectly by returning a value but 3 parameters are required. Even I tried in main with Public Shared, but the module turns into class file. Any help is much appreciated.

Thanks,
Malathi
Jun 25 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.