Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Passing a variable from a form to a console...

Status
Not open for further replies.

neoleachster

Automotive
Apr 20, 2012
5
0
0
GB
Hi,

I've written a form application in VB 2010 that defines a variable, and then runs a console application. I need to pass that single variable (which is a string) from the form application to a console application, (which is a separate program, not a console within the same project). I need then to use that variable in the console app to carry out further operations.

If anyone could help me out I would much appreciate it.

Thanks
 
Replies continue below

Recommended for you

I've solved this problem now.

For anyone who wants to know, use the following in app 1:

dim newprocess as new process()
newprocess.startinfo.filename = "Filelocation"
newprocess.startinfo.arguments = "variable"
newprocess.start()

then in the second application, use:

dim argumentsplit() as string

dim variable as string

for each argument as string in My.Application.CommandLineArgs

argumentsplit = argument.split("symbol")

variable = argumentsplit(0)

next

cheers



 
Status
Not open for further replies.
Back
Top