OS-GETENV Not Picking up New Value

Posted by jquerijero on 12-Oct-2007 15:57

It looks like Progress is caching the environment variables, so it's not picking up the new value of the enviroment variable when the value has changed and a session is running.

Does anyone have a work-around to this problem?

All Replies

Posted by Thomas Mercer-Hursh on 12-Oct-2007 16:13

What is the mechanism of change. Are you really sure that it is changed?

Posted by jquerijero on 12-Oct-2007 16:21

Just go to the My Computer and access the Enviroment variable and change from there.

After some more reading, OS-GETENV documentation actually says;

This function returns the value of an environment variable defined before the ABL session started, not a variable defined during the session.

I'm thinking of implementing GetEnvironmentVariable API call.

Does anyone have the Progress definition for this API call?

Posted by Thomas Mercer-Hursh on 12-Oct-2007 16:26

Yes, this is why I asked the question. Changing the default value makes no change to a running session, I believe. I'm not a Windows person except by necessity, but certainly in Unix there are a lot of ways to think one is changing something and one isn't changing it at all. I suspect that it isn't just the OS-GETENV is perverse, but that the value hasn't changed for an already instantiated session. Could be wrong, of course, but that would be my first guess.

Posted by Admin on 12-Oct-2007 16:34

Thomas, you're right. Changing the default values for enviroment variables on windows does not affect running processes.

But a question to Joseph: What's your goal when you change environment variables and you'd like a progress session to pick up that value? There may be plenty of other solutions. If the value needs to be changed from outside a progress runtime, you might use the windows registry or flat files. If the value has to be changed within the progress session, use GLOBAL SHARED variables, a temp-table or a class file or something similar to store your value.

Posted by jquerijero on 16-Oct-2007 14:43

Message was edited by: Joseph Querijero

Posted by Thomas Mercer-Hursh on 16-Oct-2007 14:54

Then it would appear that you should find some other source for the client name.

Posted by jquerijero on 16-Oct-2007 15:02

Yes, I'm experimenting with the WIn32API call now as this is a problem not just with CLIENTNAME but also with other environment variables that are machine specific.

Posted by Admin on 16-Oct-2007 16:21

Did you try to post this to some Microsoft forum? Sound much more like a MS issue than a Progress issue, all the tools I have worked with in the past behave the same way with environment variables.

Mike

Posted by jquerijero on 18-Oct-2007 14:49

You are correct as the Win32 API GetEnvironmentVariable does behave like OS-GETENV.

This thread is closed