VB Code:
Private Sub Form_Load() Dim strComm As String strComm = Command$ MsgBox strComm End Sub
How do I incorporate multiple command parameters.
I have seen a way to do it with arrays ... but that confused me
..Can anyone shed some light?
Seahag
Printable View
VB Code:
Private Sub Form_Load() Dim strComm As String strComm = Command$ MsgBox strComm End Sub
How do I incorporate multiple command parameters.
I have seen a way to do it with arrays ... but that confused me
..Can anyone shed some light?
Seahag
You could pass in a delimeted string something like
[arg1][arg2]
and then just parse it apart by grabing whatever is between the brackets. Use Instr to find the the brackets
gl
I have found this.. but cant get it to work in the If statements.
VB Code:
Private Sub Form_Load() Dim sArgs() As String Dim i As Integer sArgs = Split(Command, ",") For i = 0 To UBound(sArgs) Print sArgs(i) Next i If sArgs(0) = "yes" Then MsgBox "YUp0" Else MsgBox "nope" End If If sArgs(1) = "yes" Then MsgBox "YUp1" Else MsgBox "nope" End If If sArgs(2) = "yes" Then MsgBox "YUp2" Else MsgBox "nope" End If End Sub
VB Code:
Private Sub Form_Load() Dim sArgs() As String Dim i As Integer sArgs = Split(Command, "/") If sArgs(1) = "yes " Then MsgBox "YUp1" Else MsgBox "nope" End If If sArgs(2) = "yes " Then MsgBox "YUp2" Else MsgBox "nope" End If If sArgs(3) = "yes" Then MsgBox "YUp3" Else MsgBox "nope" End If End Sub