Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing values through the command prompt

Status
Not open for further replies.

marcseys

Programmer
Dec 6, 1999
23
0
0
GB
Hi,

I want to write an application which is working with the values parsed by another application through the command prompt. How do you do that in VB? Working with VB6

Thkx
Marc

marc_seys@belgacom.net


 
Ah yes multiple commands
My favorite.
I use a Pipe to separate them. but they appear to the program as one long string

Say you pass Invoice Number and Date and Amount

Public Function GetCommands(info)
'33455|02/12/01|45.67 Also for testing this I passed a parameter in info
Dim Mystuff As String
Dim FirstPipe, SecondPipe As Integer
‘ Dim PassedInvoice, PasedAmount, PassedDate As String
Mystuff = Command
'Mystuff = info
FirstPipe = InStr(1, Mystuff, "|")
SecondPipe = InStr(FirstPipe + 1, Mystuff, "|")
‘ you can make these Global variables
PassedInvoice = Left(Mystuff, FirstPipe - 1)
PassedDate = Mid(Mystuff, FirstPipe + 1, SecondPipe - FirstPipe - 1)
PasedAmount = Right(Mystuff, Len(Mystuff) - SecondPipe)

End Function
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
There is also a Split() function that breaks a string into pieces at the delimiter of your choosing. The pieces are returned in a variant array of strings--very convenient! Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top