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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting enviroment variables

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
We are using 3rd party software in our program that runs on a server, for this software to work I would need to set enviroment/system variables during run time on the client machine.

The value can change up to 4 or 5 times during our program executable.

Does any one know if it is possible to set enviroment variables for Win98 and WinXP from withing Paradox 9? Please any help would be greatly appreciated it!!

Thanks Richard
 
I also forgot to ask: How can I get the 3rd party software to close?

I use the execute command to open the program, but how can I close it from within Paradox 9?

Thanks
 
Well, writeenvironmentstring() only changes the *copy* of the environment that Paradox uses.

You'll need to use the SET command to change the environment vars that your system, and other programs, use.

As to closing, there are functions you can use through Windows to communicate with other apps. But I'm not familiar enough with them (nearly zero) to help there.

You can always use sendkeys, after finding the app and bringing it to top. Not elegant, but you can usually make it work.

Tony McGuire
 
Thanks Tony, I messed around with the write and set and it seems to be working thanks ;-)
 
Although....

The SET command you mentioned. Do you mean the SET command in DOS? How would I go about doing that, because the value of the variable can change up to 5 times in a single execution of our program...

Any help is greatly appreciated!!

 
The SET command you mentioned. Do you mean the SET command in DOS? How would I go about doing that, because the value of the variable can change up to 5 times in a single execution of our program..."

Well, at this point anything I said would be guessing.

But if that other program is left running, it likely won't know about changes to the environment var if changed by Paradox while it is running.

Sounds like you'll need to close the other program each time the var gets changed.

Lastly, sometimes you just can't make things work unless you get that 'other' program's developers to make some changes. Sounds like you might not be able to make this work.

Wish I had a better reply. Maybe someone else has an idea and will step in.


Tony McGuire
 
I'd like to add that a program that drelies on an environment var to change to store stuff between applications is poorly written.

That is, unless it isn't actually designed to communicate with other apps.

Can you go into more detail on how this 'other' app works, and why the environment is used for communicating between apps?

Tony McGuire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top