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?
What is the mechanism of change. Are you really sure that it is changed?
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?
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.
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.
Message was edited by: Joseph Querijero
Then it would appear that you should find some other source for the client name.
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.
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
You are correct as the Win32 API GetEnvironmentVariable does behave like OS-GETENV.