|
-
Dec 6th, 2001, 04:08 PM
#1
Thread Starter
Fanatic Member
Command$ multiple args
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
-
Dec 6th, 2001, 04:32 PM
#2
Member
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
VB 6, SQL, Java, AutoLISP, Avenue and on a good day AML
-
Dec 6th, 2001, 04:43 PM
#3
Thread Starter
Fanatic Member
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
-
Jan 27th, 2002, 01:31 AM
#4
Hyperactive Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|