Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Interfacing VB With PERL???

Posted on 1998-11-26
Medium Priority
Last Modified: 2010-05-03
OK, THis should be a sinch form any real VB or Perl Guru but it has had me stumped for some time... Hope you can help

I need to be able to pass values from an executable perl script to a VB Application...Sound easy.
I ahve managed to work around this by using an intermediate file but this  is cumbersome and inneficient...THERE MUST BE A BETTER WAY!!

I do not need to send commands or information to the perl script but the script must be able to returna value to VB ...

Hope you can help, Thanx in advance

Wayne Lee-Archer
Managing Director
Everything Multimedia Australia P/L
Question by:Flubbadub
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Expert Comment

ID: 1447032
use the Command function

Author Comment

ID: 1447033
?????......Please elaborate, are we talking from the Perl end of the deal or The VB end of the deal, i need to be able to send info back from perl to VB...

W. *confused*

Expert Comment

ID: 1447034
i actually create a vb program that was called from a perl script. So, from Perl, the user would type something:
ole test.gif test2.gif
where ole is the vb executable. This would start up the vb program which requires 2 file parameters. Below is a part of the vb code that processes these parameters.

Dim filename As String
Dim Action As Object
'number of max parameters
Dim param(2) As String
'the current parameter number you're on
Dim paramCounter As Integer
'the number of times run through a loop
Dim loopCounter As Integer
'the character the loop is looking at
Dim currentCharacter As String
Dim parameters As String
Dim ReturnValue As Variant
Dim I As Variant
Dim strText As String
Dim strCurrentPath As String
Dim strFullPath As String
Dim strFile As String * 2
parameters = Command()
strCurrentPath = CurDir
paramCounter = 1

For loopCounter = 1 To Len(parameters)
      currentCharacter = Mid$(parameters, loopCounter, 1)
      If currentCharacter = " " Then  'break between parameters
         paramCounter = paramCounter + 1   'start reading a new parameter
         param(paramCounter) = param(paramCounter) & currentCharacter
      End If
Next loopCounter
strFile = param(1)
For loopCounter = 1 To Len(strFile)
      currentCharacter = Mid$(parameters, loopCounter, 1)
     If currentCharacter = ":" Then
         strFullPath = param(1)
      ElseIf currentCharacter = "\" Then
         strFullPath = strCurrentPath & param(1)
         strFullPath = strCurrentPath & "\" & param(1)
      End If
   Next loopCounter


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 1447035

Very Close.....I will give you the points anyway (submit next response as an answer) but from what I can see here, the Perl script must call the VB App.  I need the VB app to call the Perl script and get some feedback from it....does or will this method work that way too???

*happy* W.

Accepted Solution

hobster earned 400 total points
ID: 1447036
With the method I just gave you, you can only call the vb program from perl. That program will also take any parameters that perl sends out.

To get the vb program to call the perl script, you need something like this:

RetVal = Shell("perl.exe C:\script.pl [param1] [param2], 1)

Note that the above code is also sending some parameters to the perl script. Good luck!

Author Comment

ID: 1447037

Looks like I am asking a bit too much.. you have helped greatly and probly saved me a lot of time and $$......to implement the project using your answer i would have to split the VB app into multiple little exe's an that is just YUKKKY!.....so much for interaction between languages! :-(

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question