Solved

Passing a variable to VB exe

Posted on 1998-08-13
6
292 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
ID: 1468700
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
ID: 1468701
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
ID: 1468702
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 14

Expert Comment

by:waty
ID: 1468703
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
ID: 1468704
Thanks for the respone
0
 
LVL 1

Author Comment

by:tuck
ID: 1468705
Thanks for the response
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

837 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