R
Ricky W. Hunt
First, I apologize for asking so many questions. General programming terms
must have changed so much in the last 10 years since I've been out of it
because I can't seem to find ANYTHING in MS's help file if I don't have a
keyword to start with.
I'm looking for a way to pass an argument to the EXE at runtime so I can
branch to different things inside the program depending on what I pass it.
For instance in the desktop shortcut under target I'd like to be able to
put:
"program.exe" 1
to pass the integer 1 into the program, etc.
Can someone point me to the right way (if this is possible).
Here's the code I came up with (not sure if it's right): New is my "main"
entry point
Public Sub New(Optional ByVal arg1 As Integer = 0)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
InitDirectSound()
Randomize()
'If HideDisplay = 1 Then
If arg1 = 1 Then
lblFreq.Visible = False
lblGain.Visible = False
Label4.Visible = False
Label3.Visible = False
End If
End Sub
must have changed so much in the last 10 years since I've been out of it
because I can't seem to find ANYTHING in MS's help file if I don't have a
keyword to start with.
I'm looking for a way to pass an argument to the EXE at runtime so I can
branch to different things inside the program depending on what I pass it.
For instance in the desktop shortcut under target I'd like to be able to
put:
"program.exe" 1
to pass the integer 1 into the program, etc.
Can someone point me to the right way (if this is possible).
Here's the code I came up with (not sure if it's right): New is my "main"
entry point
Public Sub New(Optional ByVal arg1 As Integer = 0)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
InitDirectSound()
Randomize()
'If HideDisplay = 1 Then
If arg1 = 1 Then
lblFreq.Visible = False
lblGain.Visible = False
Label4.Visible = False
Label3.Visible = False
End If
End Sub