arguments passing.

  • Thread starter Thread starter Justine
  • Start date Start date
J

Justine

Can anyone help?
e.g. when you open a vb project property page, in "Configuration
Properties"
You will see "Command line arguments" in "Start Options". Does anyone
knows how to find a way to do arguments passing. Thank you.
 
Justine said:
Can anyone help?
e.g. when you open a vb project property page, in "Configuration
Properties"
You will see "Command line arguments" in "Start Options". Does
anyone knows how to find a way to do arguments passing. Thank you.

To start another app and pass command line arguments:
shell "theother.exe arguments"
Or use
Process.Start


To use the command line arguments passed to your own app:
msgbox command 'Microsoft.VisualBasic.Interaction.Command
 
* (e-mail address removed)-spam.invalid (Justine) scripsit:
Can anyone help?
e.g. when you open a vb project property page, in "Configuration
Properties"
You will see "Command line arguments" in "Start Options". Does anyone
knows how to find a way to do arguments passing. Thank you.

You can enter arguments there. When starting the application outside
the IDE, you can use a shortcut or the console to pass arguments.

This code shows you how to get the passed data:

\\\
Public Sub Main(ByVal astrCmdLineArgs() As String)
Dim i As Integer
For i = 0 To astrCmdLineArgs.Length - 1
Console.WriteLine(astrCmdLineArgs(i))
Next i
End Sub
///

- or -

\\\
Public Sub Main()
Dim i As Integer
For i = 0 To Environment.GetCommandLineArgs().Length - 1
Console.WriteLine(Environment.GetCommandLineArgs(i))
Next i
End Sub
///

Notice that the startup object must be set to 'Sub Main'.
 
Back
Top