?
Solved

Passing a variable to VB exe

Posted on 1998-08-13
6
Medium Priority
?
320 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 800 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

770 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