Click here to Skip to main content
15,921,716 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralTextBox Question Pin
6-Jun-01 22:15
suss6-Jun-01 22:15 
GeneralRe: TextBox Question Pin
15-Jun-01 12:13
suss15-Jun-01 12:13 
GeneralRe: TextBox Question Pin
15-Jun-01 12:15
suss15-Jun-01 12:15 
GeneralTrying to detect Cancel in ShowPrinter Pin
jamesdturner@hotmail.com6-Jun-01 17:01
jamesdturner@hotmail.com6-Jun-01 17:01 
GeneralRe: Trying to detect Cancel in ShowPrinter Pin
AndyG6-Jun-01 17:26
AndyG6-Jun-01 17:26 
GeneralWriting selected cells from Excel in csv Pin
6-Jun-01 4:16
suss6-Jun-01 4:16 
GeneralPassing in variables to a VB executable Pin
31-May-01 12:46
suss31-May-01 12:46 
GeneralRe: Passing in variables to a VB executable Pin
AndyG3-Jun-01 22:04
AndyG3-Jun-01 22:04 
Taken from MSDN:

Function GetCommandLine(Optional MaxArgs)
'Declare variables.
Dim C, CmdLine, CmdLnLen, InArg, I, NumArgs
'See if MaxArgs was provided.
If IsMissing(MaxArgs) Then MaxArgs = 10
'Make array of the correct size.
ReDim ArgArray(MaxArgs)
NumArgs = 0: InArg = False
'Get command line arguments.
CmdLine = Command()
CmdLnLen = Len(CmdLine)
'Go thru command line one character
'at a time.
For I = 1 To CmdLnLen
C = Mid(CmdLine, I, 1)
'Test for space or tab.
If (C <> " " And C <> vbTab) Then
'Neither space nor tab.
'Test if already in argument.
If Not InArg Then
'New argument begins.
'Test for too many arguments.
If NumArgs = MaxArgs Then Exit For
NumArgs = NumArgs + 1
InArg = True
End If
'Concatenate character to current argument.
ArgArray(NumArgs) = ArgArray(NumArgs) & C
Else
'Found a space or tab.
'Set InArg flag to False.
InArg = False
End If
Next I
'Resize array just enough to hold arguments.
ReDim Preserve ArgArray(NumArgs)
'Return Array in Function name.
GetCommandLine = ArgArray()
End Function

If you need help changing this code around to fit your needs, just reply. Basically everything in the command line gets passed in by the Command Function.
Question"Unrecognized format"? Pin
Jason Teagle31-May-01 8:15
Jason Teagle31-May-01 8:15 
AnswerRe: Pin
AndyG3-Jun-01 22:16
AndyG3-Jun-01 22:16 
GeneralRe: Pin
Jarek G8-Jun-01 10:41
Jarek G8-Jun-01 10:41 
Generaldeploiying an access project Pin
30-May-01 9:53
suss30-May-01 9:53 
GeneralRe: deploiying an access project Pin
2-Jun-01 8:58
suss2-Jun-01 8:58 
GeneralGetting the Caret Location Pin
30-May-01 4:37
suss30-May-01 4:37 
GeneralRe: Getting the Caret Location Pin
Jason Teagle31-May-01 8:21
Jason Teagle31-May-01 8:21 
GeneralRe: Getting the Caret Location Pin
31-May-01 10:23
suss31-May-01 10:23 
GeneralRe: Getting the Caret Location Pin
Jason Teagle31-May-01 10:36
Jason Teagle31-May-01 10:36 
GeneralRe: Getting the Caret Location Pin
31-May-01 10:45
suss31-May-01 10:45 
GeneralRe: Getting the Caret Location Pin
Jason Teagle31-May-01 10:52
Jason Teagle31-May-01 10:52 
GeneralRe: Getting the Caret Location Pin
31-May-01 11:11
suss31-May-01 11:11 
GeneralRe: Getting the Caret Location Pin
Jason Teagle31-May-01 11:13
Jason Teagle31-May-01 11:13 
Generaltest Pin
28-May-01 20:28
suss28-May-01 20:28 
Generaltest 2 Pin
28-May-01 20:29
suss28-May-01 20:29 
GeneralHi Test Only Pin
7-Jun-01 17:10
suss7-Jun-01 17:10 
GeneralRe: Hi Test Only Pin
Ulf Öhlén7-Jun-01 22:26
Ulf Öhlén7-Jun-01 22:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.