Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass variable from PERL to VB.NET?

Status
Not open for further replies.

dmoonme

MIS
Jul 21, 2004
33
0
0
US
I need a VB.NET program to see an "exit status" from the Perl program. Basically, we need to know if the Perl programs can signal to the VB.NET program whether
succeeded or failed. How can I do this?
 
The Perl program can return an exit status with the exit() function. Typically, 0 is returned for success and non-zero for failure.

Whether the VB.Net program can capture this status I don't know, as I don't know VB.Net. But I would guess there's some facility for something as basic as capturing the exit status of an external program, no?
 
the shell command in VBA and VB didn't care (fire and forget) as long as the syntax of the command fired.

You may have to introduce some basic semaphores if something doesn't exist.

On entry of the perl script, create a small text file, that your VB.Net process can monitor, and on exit of Perl script, delete the file allowing the VB.Net prog to proceed

Just an idea, though if the perl scripts fail regularly, you may need to introduce some housekeeping system

HTH
--Paul

Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
After reading Paul's post, I looked up the Shell function in MS Visual Basic help:
Runs an executable program and returns a Variant (Double) representing the program's task ID if successful, otherwise it returns zero.

Shell Function Example
This example uses the Shell function to run an application specified by the user.
...
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' Run Calculator
If I u/s this correctly, RetVal would contain a zero if the process failed, non-zero if it succeeded. (The reverse of the usual *nix convention.)

I haven't written any VB or VBA lately, and I haven't tried this. Just a direction to look in.





 
Alas I used to think so too.

The retval just says whether the command initiated, not that it completed successfully.

--Paul

Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
Yes, the vb shell() function returns to you before the thing it calls finishes.

Mike

To err is human,
but to really foul things up -
you require a man Mike.

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top