Solved

VB EXE

Posted on 1998-12-17
5
284 Views
Last Modified: 2010-05-03
I have an exe with 2 bas  modules in a project and i need to pass command line arguments to the exe
how can i do this ?
0
Comment
Question by:sujmags
5 Comments
 
LVL 2

Expert Comment

by:polygon
ID: 1451118
I can's exactly understand your question, but if you need to know the command parameters of your program, use Command function. And if you want to specify some parameters for the debugging of your program, use your projects properties to specify such.

BTW, while debugging you can never get the same parameters as when running an exe. This is because to run your project in a debug session, VB specifies it as a parameter to some exe.
0
 
LVL 1

Expert Comment

by:OeilNoir
ID: 1451119
i don't understand well the question either.. but if you mean you need to call an exe from your app and you need to pass parameters to it, then
simply use the "shell" command and write the prametres in it

Exemple :
shell "c:\test.exe /param1"
or
shell "c:\test.exe "  & strParam
0
 

Author Comment

by:sujmags
ID: 1451120
I'll make the question more clear,
this is the st that i have within my sub main ()
I have an exe which comprises of sub main and one more module , i need to pass commandline args for this exe.

submain has a st. like this , these values are passed directly but instead these have to be read from command line.
(given below is the sample module)

gbRetState = CheckParameters("c:\a.rpt", "12-Dec-98", "RPT01", "JOB01")

Public Sub Main()
   Dim RetVal As Boolean
   
 
 
 'Check parameters
   gbRetState = CheckParameters("c:\a.rpt", "12-Dec-98", "RPT01", "JOB01")
    If gbRetState = False Then
        Call ErrorFileUpdate("Process Status: Invalid parameter")
        Screen.MousePointer = gbArrow
        Exit Sub
    End If
   
 End Sub
0
 
LVL 1

Accepted Solution

by:
jeffcameron earned 10 total points
ID: 1451121
use the Command() function in VB to get parameters from the command line
0
 

Author Comment

by:sujmags
ID: 1451122
Thanks jeff, really appreciate the timely response
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBS file using code from 2nd file (txt or vbs) 4 36
message box in access 4 46
VB6 - Convert HH:MM into Decimal 8 54
VBA - If Bookmark = "XXBOOKMARKXX" then 15 28
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

772 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