Sergey,
Thanks. The FAQ response written by Ed Rauh worked for me.
Alan
>>GetEnv() returns the value of an o/s environment variable. Is there a way to "set" the value of an environment variable?
>>
>>I want to set an "errorlevel" variable so that our Autosys scheduler will know to report either success or failure based on the errorlevel o/s variable.
>>
>
>Hi Alan,
>
>You can change enviroment variables for the current process using GetEnvironmentVariable Win API function
http://news2news.com/vfp/?function=-1&example=152 but it'll be gone after application finishes. If you want to change system enviroment variables, see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/environment_variables.asp>It's not the same but maybe
Exiting Visual FoxPro returning an error level FAQ #7767 will work for you?