Link to home
Start Free TrialLog in
Avatar of tuck
tuck

asked on

Passing a variable to VB exe

I need to pass a variable to my vb prog is there a way to do this,
What i need to end up with is my.exe "string"
So that i can do certain events with different strings passed to the exe...

Thanks in advance

Avatar of Dalin
Dalin

tuck,
I am not sure what your "string" is used for, but you can always put it to an INI file. In your exe, you read it from the INI file before anything else, and you can change the content of the INI file.
regards
Dalin
Avatar of tuck

ASKER

What i realy mean is to have command line switches for the compiled exe as i want to do different things depending on the switch entered in by a user..
Thanks
ASKER CERTIFIED SOLUTION
Avatar of deighton
deighton
Flag of United Kingdom of Great Britain and Northern Ireland image

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
deighton has just answer before me.

use the command$ function :

Dim sToExecute as string

sToExecute = Command$

Select sToExecute
    Case "Format":
        ' *** Format code
        ...........        
    Case "Delete":
        ' *** Delete code
        ...........        
    Case "Copy":
        ' *** Copy code
        ...........

       
Avatar of tuck

ASKER

Thanks for the respone
Avatar of tuck

ASKER

Thanks for the response