Link to home
Start Free TrialLog in
Avatar of kentyo
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
Avatar of johnsand
johnsand

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kentyo
kentyo

ASKER

Can I have sample code
 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(COMMAND$,"/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)