Return a floating pt value to a script variable

pts.
Tags:
Visual Basic
I have a visual basic program that generates a single floating point number as its output. I would like to modify the program to stuff this value into a variable than can be used in a VB script. The idea is that the script would run the visual basic program and then use the value generated by the program throughout the remainder of the script. I've done this in with Fortran under Unix and other operating systems, but haven't a clue of how to do it in Visual Basic and Windows.

Answer Wiki

Thanks. We'll let you know when a new response is added.

If your program doecn’t have a user interface and is merely an executable that you launch, you could rewrite it as an ActiveX DLL project. Call a public function that would run whatever code you are using then return your variable which you could use in a VB Script, ASP page, etc.

<%’Script page example:
myObject = Create.Object(“myProject.clsMyClass”)
myVariable = myObject.myFunction
%>

myProject Function Example:
Public Function myFunction() as Float
Dim anyVariable as Float
‘Do stuff here
myFunction = anyVariable
End Function

Hope this helps!

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following