Solved

Passing a variable to VB exe

Posted on 1998-08-13
6
258 Views
Last Modified: 2010-05-03
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

0
Comment
Question by:tuck
6 Comments
 
LVL 9

Expert Comment

by:Dalin
Comment Utility
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
0
 
LVL 1

Author Comment

by:tuck
Comment Utility
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
0
 
LVL 18

Accepted Solution

by:
deighton earned 200 total points
Comment Utility
Use the variable command$ in your program, this will then hol the value passed on your command line, you don't need quotes around the string when using it.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 14

Expert Comment

by:waty
Comment Utility
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
        ...........

       
0
 
LVL 1

Author Comment

by:tuck
Comment Utility
Thanks for the respone
0
 
LVL 1

Author Comment

by:tuck
Comment Utility
Thanks for the response
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now