RE: Perl calling Visual Basic

2002-02-22 Thread Dean Theophilou

Of course, you can always have VB output the results to a text file and then
have Perl read it.  I think that would probably be the simplest way to do it.

Dean Theophilou


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Chris Ball
Sent: Friday, February 22, 2002 8:27 AM
To: Chris
Cc: [EMAIL PROTECTED]
Subject: Re: Perl calling Visual Basic


>>>>> "chris" == chris  <[EMAIL PROTECTED]> writes:

chris> @result = `myCompiledVBApp AnyArgs`;
chris> Anyone think I have lost my mind, or did I get one right???

Close.  I don't see why you're passing the return to an array rather
than scalar (@ rather than $), since it should just be an integer.
You're also capturing the output of the program when you use backticks,
rather than the return code, which is captured using system().

To execute and capture the return code of a program, I'd use:

  $return_code = system('program');

 but that assumes that the 'program' is something that can be entirely
executed from the command line and returns a useful return code - I
don't have familiarity with VB, but my short experiences seem to suggest
that this would be rare.

*awaits correction from Japhy*  :-)

- Chris.
--
$a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
 "In the beginning there was nothing, which exploded."


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl calling Visual Basic

2002-02-22 Thread Chris Ball

> "chris" == chris  <[EMAIL PROTECTED]> writes:

chris> @result = `myCompiledVBApp AnyArgs`;
chris> Anyone think I have lost my mind, or did I get one right???

Close.  I don't see why you're passing the return to an array rather
than scalar (@ rather than $), since it should just be an integer.
You're also capturing the output of the program when you use backticks,
rather than the return code, which is captured using system().

To execute and capture the return code of a program, I'd use:

  $return_code = system('program');

... but that assumes that the 'program' is something that can be entirely
executed from the command line and returns a useful return code - I
don't have familiarity with VB, but my short experiences seem to suggest
that this would be rare.

*awaits correction from Japhy*  :-)

- Chris.
-- 
$a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
 "In the beginning there was nothing, which exploded."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl calling Visual Basic

2002-02-22 Thread Jenda Krynicky

From:   Chris <[EMAIL PROTECTED]>
> Calling the VB app "should" be fairly straight, if it is local to the
> Perl program...
> 
> @result = `myCompiledVBApp AnyArgs`;
> 
> If the VB App returns anything, the @result should (hopefully???)
> catch it...

I don't think the VB application will print anything to STDOUT.
Maybe he should use system() :

system 'myCompiledVBApp AnyArgs' == 0
or die "system('myCompiledVBApp AnyArgs') failed: $?";
$exit_value  = $? >> 8;

Depends on HOW does the VB app "return" the result.

Jenda


=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl calling Visual Basic

2002-02-22 Thread Chris

Joanne Kowalinski wrote:
> Hi,
> 
> I am thoroughly lost and do not know how to do this, or even if it is
> possible to do.
> We want to have an activestate perl program running on one of our NT
> gateways call
> a Visual Basic  application. The return code from the VB app will then
> control the
> path the Perl program takes.
> I have searched the internet for anything about Perl calling VB and can
> find nothing.
> Any help would be appreciated!
> 
> Thank you - Joanne Kowalinski
> 
> 
> 
> 
> 
> 

Calling the VB app "should" be fairly straight, if it is local to the 
Perl program...

@result = `myCompiledVBApp AnyArgs`;

If the VB App returns anything, the @result should (hopefully???) catch 
it...

Anyone think I have lost my mind, or did I get one right???
:P

Chris


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]