Solved

VB EXE

Posted on 1998-12-17
5
281 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

708 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

16 Experts available now in Live!

Get 1:1 Help Now