kentyo
asked on
Passing parameter to VB programs
I am VB new user. Can tell me how VB program pass and recieve parameter values from one program to another. Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For the COMMAND$ the code is easy.
Sub Form_Load()
'check if something was passed on the commandline
if COMMAND$ <> "" then
'if a /F is found then the user passed a filename
if instr(COMMAND$,"/F") then
'Parse the filename out and save it
sFilename = Mid$(COMMAND$,instr(COMMAN D$,"/F")+ 2)
end if
else
msgbox "You must pass a filename as /Ffilename.ext"
end if
end sub
To pass the filename to a seperate program, just shell out like this
lResult = shell("OTHER.EXE /F" + sFilename)
Sub Form_Load()
'check if something was passed on the commandline
if COMMAND$ <> "" then
'if a /F is found then the user passed a filename
if instr(COMMAND$,"/F") then
'Parse the filename out and save it
sFilename = Mid$(COMMAND$,instr(COMMAN
end if
else
msgbox "You must pass a filename as /Ffilename.ext"
end if
end sub
To pass the filename to a seperate program, just shell out like this
lResult = shell("OTHER.EXE /F" + sFilename)
ASKER