Solved

Passing a variable to VB exe

Posted on 1998-08-13
6
308 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

737 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