Hi Valery,
I have implemented this functionality in our latest version.
It will appear as 2.00/10.
I did not want to modify the calling sequence of TObject::Write.
I simply use a convention for the first argument.
New option in TObject::Write(const char *name).
If the first character of name is '+', a previous key with
name=name is overwritten by this new object.
example 1, with a TNamed derived object:
obj->Write("+")
will replace the previous key (named obj->GetName()) by the
new object
and the same name.
example 2, (TNamed derived object or not):
obj->Write("+Hello");
will replace an existing object named "Hello" in the file by the
new object
The choice of "+" is may be debatable (in my mind, overwrite).
"-" is may be better (would mean, delete previous cycle if any).
Rene Brun