Greets all. I'm attempting to write an app that will be used as a
'control/launcher' application for other apps. For the sake of argument
let's say the app is launched from a command line:
controlapp externalapp argument1 argument2 argument3 argument4...etc.
(number of arguments is ALWAYS dynamic)
I'm been able to get the array passed properly, but ONLY when I know in
advance the amount of items in the array. I'm stuck on how to allow for
any amount of arguments.
Dim applaunch As Process = New Process()
Dim arrayCount As Integer, appArgs() As String
'pull external exe path/name and arguments into array, then count array
items
appArgs = System.Environment.GetCommandLineArgs
For arrayCount = 0 To UBound(appArgs)
Next arrayCount
'command line = controlapp externalapp argument1 argument2 argument3
'I start at 2nd item in array, as appargs(0) = controlapp
applaunch.StartInfo.FileName = appArgs(1)
applaunch.StartInfo.Arguments = appArgs(2) & " " & appArgs(3) & " " &
appArgs(4)
Hopefully this is enough of the code to figure out what my next step should
be. I'm learning as I go with vb.net, so if I missed an incredibly obvious
solution, please be gentle! Additionally, is this even a good way of doing
it? Thanks in advance! 2 4250
"pyrexia" <py*****@hotmail.com> wrote in message
news:uW**************@TK2MSFTNGP15.phx.gbl... Greets all. I'm attempting to write an app that will be used as a 'control/launcher' application for other apps. For the sake of argument let's say the app is launched from a command line:
controlapp externalapp argument1 argument2 argument3 argument4...etc. (number of arguments is ALWAYS dynamic)
I'm been able to get the array passed properly, but ONLY when I know in advance the amount of items in the array. I'm stuck on how to allow for any amount of arguments.
Dim applaunch As Process = New Process() Dim arrayCount As Integer, appArgs() As String
'pull external exe path/name and arguments into array, then count array items appArgs = System.Environment.GetCommandLineArgs
******** What does this loop do ? ************************ For arrayCount = 0 To UBound(appArgs)
********** why not add something in the loop like ***********************
applaunch.StartInfo.Arguments = applaunch.StartInfo.Arguments & "
" & appArgs(arrayCount)
*********************************************** Next arrayCount
'command line = controlapp externalapp argument1 argument2 argument3 'I start at 2nd item in array, as appargs(0) = controlapp applaunch.StartInfo.FileName = appArgs(1) applaunch.StartInfo.Arguments = appArgs(2) & " " & appArgs(3) & " " & appArgs(4)
Hopefully this is enough of the code to figure out what my next step
should be. I'm learning as I go with vb.net, so if I missed an incredibly obvious solution, please be gentle! Additionally, is this even a good way of doing it? Thanks in advance!
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.grisoft.com).
Version: 6.0.769 / Virus Database: 516 - Release Date: 9/25/2004
Pyrexia,
Probably will this do the Job for you.
\\\
Public Sub MySub(ByVal ParamArray Args() As String)
'....Args is just an array with unknow lenght of strings in this case
End sub
////
I hope this helps?
Cor
"pyrexia" Greets all. I'm attempting to write an app that will be used as a 'control/launcher' application for other apps. For the sake of argument let's say the app is launched from a command line:
controlapp externalapp argument1 argument2 argument3 argument4...etc. (number of arguments is ALWAYS dynamic)
I'm been able to get the array passed properly, but ONLY when I know in advance the amount of items in the array. I'm stuck on how to allow for any amount of arguments.
Dim applaunch As Process = New Process() Dim arrayCount As Integer, appArgs() As String
'pull external exe path/name and arguments into array, then count array items appArgs = System.Environment.GetCommandLineArgs For arrayCount = 0 To UBound(appArgs) Next arrayCount
'command line = controlapp externalapp argument1 argument2 argument3 'I start at 2nd item in array, as appargs(0) = controlapp applaunch.StartInfo.FileName = appArgs(1) applaunch.StartInfo.Arguments = appArgs(2) & " " & appArgs(3) & " " & appArgs(4)
Hopefully this is enough of the code to figure out what my next step should be. I'm learning as I go with vb.net, so if I missed an incredibly obvious solution, please be gentle! Additionally, is this even a good way of doing it? Thanks in advance!
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Darren Dale |
last post by:
Hello,
def test(data):
i = ? This is the line I have trouble with
if i==1: return data
else: return data
a,b,c,d = test()
|
by: Gregory Piñero |
last post by:
Hey guys, would someone mind giving me a quick rundown of how
references work in Python when passing arguments into functions? The
code below should highlight my specific confusion:
<code>
...
|
by: Harolds |
last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005
the pmID is evaluated to "" instead of what the value is set to:
....
xmlItems.Document = pmXML
// Add the pmID...
|
by: dharmadam |
last post by:
Is it possible to pass a column name or the order of the column name
in the DB2 table table function. For example, I want to update the
address of a person by passing one of the address column name...
|
by: Mike MacSween |
last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime
ago.
Then remembered that arguments are passed by reference, by default.
Does the fact that this slowed me down...
|
by: Colmag |
last post by:
I'm running a console application (ghostscript) by starting it as a process
with arguments.
The problem i'm having is that it's falling over when I pass a file
containing spaces in the filename...
|
by: Bonzo |
last post by:
>From within a function, I want to pass a/some parameters to another
function, AND all arguments, passed into this function.
e.g.
function firstFunction(){
//this function may have been...
|
by: zholthran |
last post by:
Hi folks,
after reading several threads on this issue (-> subject) I fear that I
got a problem that cannot easily be solved by the offered workarounds
in an acceptable way, at least not with my...
|
by: rottmanj |
last post by:
I am working on an application that requires me to use an external application to pull data from a odbc proxy. One issue that I have run into is trying to figure out how to pass data from my...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
| |