|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sub Main() With Parameters.
Hello, I have recently run into this problem: I created a vb application with Sub Main() as the startup object and it worked fine, but when I tried to add parameters to Sub Main() it did not work at all. ex: Sub Main( param1, param2, param3, ... ). Is there like an ArgC[] and ArgV[] for a VB application to get input when it is starting up?
__________________
--Tantapants |
|
#2
|
||||
|
||||
|
You have to use command line arguments. You cannot add parameters to sub Main as it is automatically stubbed in by the compiler. I believe in the build properties (by going to the project properties) you can specify command line arguments. Also, you can specify them in any command line runtime, such as a .bat.
|
|
#3
|
|||
|
|||
|
And how do you access the command line arguments from inside the VB program? Are they passed in as an array or what?
Last edited by Tantalus : January 19th, 2004 at 04:19 PM. |
|
#4
|
|||
|
|||
|
You get a string of all the command line parameters with
mystring = Command() |
|
#5
|
||||
|
||||
|
sorry, yeah - I've been out of it for a while. What Doug said. He stole my answer.
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Sub Main() With Parameters. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|