TEnv does not remember values?

Hello Rooters,

I am trying to use class TEnv for storing some relevant information about my Program. But I am somehow not able to read the values back, when I restart my program. I checked wether they are in the file, and yes they are. Here is a simple example on what is wrong:

[code] *******************************************

  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 4.00/04 29 April 2004 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

Compiled for win32gdk.

CINT/ROOT C/C++ Interpreter version 5.15.133, Apr 18 2004
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] TEnv *env = new TEnv(".testrc");
root [1] env->SetValue("/test/window 1/dummyPosx",200);
root [2] env->SaveLevel(kEnvLocal);
root [3] int testPosx = env->GetValue("/test/window 1/dummyPosx",0);
root [4] cout << testPosx <<endl;
200
root [5] delete env;
root [6] TEnv *env = new TEnv(".testrc");
root [7] env.ReadFile(".testrc",kEnvLocal);
root [8] int testPosx = env->GetValue("/test/window 1/dummyPosx",0);
root [9] cout << testPosx <<endl;
0
root [10][/code]

I am expecting that testPosx is 200 in the second case as well. What is it that I am doing wrong?

Thank you

Lutz