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!

Setting a variable to pass to an application

Status
Not open for further replies.

dosun

Programmer
Oct 15, 2003
11
US
I am calling VB script from an application. The script
calls a VB 6 program which does calculates total freight
and outputs the total to a text file.

After the VB6 program finishes, I need to be able to
set a variable(in vbscript) to pass back to the application. I need to set the variable to the
value contained in the text file that was created in
VB 6.

Anyone know how to do this ?
 
You could pause the app's thread until the vbscript finishes: see thread222-735352

Then the app can read the text file to get the value.

Paul Bent
Northwind IT Systems
 
Let me add a little more detail. The application has a
built-in feature that allows passing the values of fields
on the screen to a vbscript. For example, I can pass the
invoice number to vbscript. I then call a VB 6 program
that calculates the freight for this invoice and writes
it to a text file.

The application I am using allows me to return a value
for any field on the screen(in this case, the amount of
the freight).

What I don't know how to due is to set this variable that
I will pass back to the application (ML_FRGHT_AMT)to the
value that I have saved in the text file.
 
Hi

if you are looking to set the value in the text file as a variable in the VB 6 application you can do it like this.

<code>
dim ML_FRGHT_AMT as string

Open App.Path + &quot;\textfile.txt&quot; For Input As #1
Input #1, ML_FRGHT_AMT
Close #1
</code>

the ML_FRGHT_AMT string will now contain the contents of the text file.

if you now pass the string back to the VB script it will have the freight amount in it.

I hope I understood your question and hope this works.

Let me know

Cheers

S.

Everything has an answer, it's just knowing the right question to ask. !!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top