473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

trapping parameters by launch of program

Hi all,

I'm really a newbie.
How can I trap (read in my program) the parameters which where giving at the
launch of the my program?

thanks for any tips
Danny
Jul 17 '05 #1
5 4234

"Danny De Koster" <dd*@fidelity-soft.be> wrote in message
news:41**********************@news.skynet.be...
Hi all,

I'm really a newbie.
How can I trap (read in my program) the parameters which where giving at the launch of the my program?

thanks for any tips
Danny


You can use the "command" function
(parameterstring = command)
To test it in the VB environment, you can go to the Project Properties under
the "Make" tab and set the argument there.
If you type command and get help on it, there is a good example
Jul 17 '05 #2
Raoul,

What I want to achieve is receiving a variable that has been send when I
launch my program.

ex.: c:\foto\foto.exe filename.bmp

I want to know the filename that has been given.
"Raoul Watson" <Wa*****@IntelligenCIA.com> schreef in bericht
news:b7SAd.6000$PY6.164@trndny02...

"Danny De Koster" <dd*@fidelity-soft.be> wrote in message
news:41**********************@news.skynet.be...
Hi all,

I'm really a newbie.
How can I trap (read in my program) the parameters which where giving at the
launch of the my program?

thanks for any tips
Danny


You can use the "command" function
(parameterstring = command)
To test it in the VB environment, you can go to the Project Properties

under the "Make" tab and set the argument there.
If you type command and get help on it, there is a good example

Jul 17 '05 #3
"Danny De Koster" <dd*@fidelity-soft.be> wrote in message
news:41*********************@news.skynet.be...
Raoul,

What I want to achieve is receiving a variable that has been send when I
launch my program.

ex.: c:\foto\foto.exe filename.bmp

I want to know the filename that has been given.


That is *exactly* what command will give you. *Whatever* parameters were
passed. For example:

c:\program files\program.exe /picture.bmp, sound.wav

will return "/picture.bmp, sound.wav"
Jul 17 '05 #4
indead. it works. Thank you very much Raoul.
"Raoul Watson" <Wa*****@IntelligenCIA.com> schreef in bericht
news:aQTAd.6008$PY6.2745@trndny02...
"Danny De Koster" <dd*@fidelity-soft.be> wrote in message
news:41*********************@news.skynet.be...
Raoul,

What I want to achieve is receiving a variable that has been send when I
launch my program.

ex.: c:\foto\foto.exe filename.bmp

I want to know the filename that has been given.


That is *exactly* what command will give you. *Whatever* parameters were
passed. For example:

c:\program files\program.exe /picture.bmp, sound.wav

will return "/picture.bmp, sound.wav"

Jul 17 '05 #5
LG
Here is a snippet of code I wrote to handle command line switches that might
help:

--snip--
If IDEMode = True Then
strCommand = "-d -t10"
Else
strCommand = Command
End If

strCmdArray = Split(strCommand, " ")

For intLoop = 0 To UBound(strCmdArray)
strCommand = strCmdArray(intLoop)
Select Case Left(strCommand, 2)
Case "-t"
If Val(Mid(strCommand, 3)) < 10 Or Val(Mid(strCommand, 3)) >
60 Then GoTo CmdError
tmrPing.Interval = Val(Mid(strCommand, 3)) * 1000
Case "-d"
blnDebug = True
Case "-?"
GoTo CmdError
Case Else
GoTo CmdError
End Select
Next
--snip--

As you can see, it allows for multiple command switches. This can be
improved of course, and IIRC I do have a rather advanced one somewhere, this
was just the one I found first.

Cheers
G
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Wugi | last post by:
I'm trying to find an equivalent of key-event trapping which is easy in QBasic. Several of my programs build up a geometric figure with two parameter line families, eg with two nested for..next...
13
by: Al Franz | last post by:
Anyone understand how to pass parameters to a JavaScript. If anyone finds this easy to do maybe they could take a look at my short script on this page and show me how it needs to be changed. ...
4
by: Brad Smith | last post by:
I have a unique requirement to run an executable file from withing a HTML document. The HTML is actually embedded in an email sent as a notification to a user of our application. I need to include...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
8
by: Mark Flippin | last post by:
This is for a reporting problem using: Access 2000 SQL Server 2000 Both at SP3 I've a stored procedure in SQL Server 2000 which builds a result set from a disparate set of tables, utilizing...
13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
1
by: sylsau | last post by:
Hello, I wrote a JAVA program which uses the JAVA API JDOM 1.0 (of this site www.jdom.org) I put the archive jdom.jar in the directory /usr/share/java/jdom.jar and I added this path in the...
2
by: william.w.oneill | last post by:
I have an application that takes a few command line parameters. As recommended by others in this group, I'm using a named mutex to ensure that only one instance of the application is running. My...
13
by: Jeff | last post by:
We have an intranet website that currently uses ActiveX but we need to make it cross-browser compatible and also get around the problems we've been having with making it work with IE7 and Vista. We...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.