I sent this response a few days ago, but it didn't get into the group,
I think because I switched mail servers and had a different "from"
name in my email:
No you don't risk losing data. The "storage" we are talking about is
the classes storage deffinition--the details of where and how the data
is stored, but not the actual stored data.
The storage definition is hidden by default in studio, but you should
probably take a look at it and get familiar with what it does. In a
class created by protoclass for a simple name/address file named MINE,
the storage looks like:
<Storage name="Default">
<Data name="MINEDefaultData">
<Value name="1">
<Value>NAME</Value>
</Value>
<Value name="2">
<Value>ADDR</Value>
</Value>
<Value name="3">
<Value>CITY</Value>
</Value>
<Value name="4">
<Value>ST</Value>
</Value>
<Value name="5">
<Value>ZIP</Value>
</Value>
</Data>
<DataLocation>^|"THHOME"|MINE</DataLocation>
<DefaultData>MINEDefaultData</DefaultData>
<ExtentSize>100000</ExtentSize>
<IdLocation>^|"THHOME"|C.MINE</IdLocation>
<IndexLocation>^|"THHOME"|I.MINE</IndexLocation>
<StreamLocation>^MVFILE.MINES</StreamLocation>
<Type>%Library.CacheStorage</Type>
</Storage>
You've got blocks in there that define the storage "slot" for each
property, like
<Value name="1">
<Value>NAME</Value>
</Value>
which means that property NAME is going to be stored in slot #1, which
for a multivalue file translates to attribute #1. For the most part
this "just works" but some problems can arise. For example, if you
rename the NAME property to be CustomerName, the class compiler will
not replace the storage entry for NAME. It will leave that alone, and
create a new slot for CustomerName--slot 6 in this case. The compiler
does that for a reason. It can't tell that CustomerName replaces NAME.
All it knows is that NAME is gone and CustomerName is new. So it holds
the slot for NAME--assuming that there may be data in the slot, or
that some legacy non-object application may be using that slot.
You can get around this default compiler behaviour by either deleting
the storage definition before recompiling, or purposely editing the
storage definition yourself, putting CustomerName in in place of Name.
You also have block in there that define what globals are going to
hold the data:
<DataLocation>^|"THHOME"|MINE</DataLocation>
In this case, the data is in the global ^MINE in namespace THHOME.
Under some circumstances, the namespace name is hard-coded into the
class, so in order to copy the class to a different namespace and use
it there, the storage needs to be ammended. Again, you can update it
manually, or just delete it and have it build a new default.
> > >> 2009/10/9 dawn<
dawnwolth...@gmail.com>