[DONE] Field column index

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Aug 18 22:25:19 CDT 2004


On 8/18/04 8:56 PM, "Ivan Smahin" <IvanSmahin at public.kherson.ua> wrote:

Exallent Ivan!

This is good news.
One more glitch behavior of Valentina 1.x fixed!


> Hello All,
> 
> Now each field has mColumnIndex
> and the pair of methods to get a property semantic.
> 
> put_ColumnIndex
> get_ColumnIndex
> 
> SysTable keeps those indexes as property of the fields.
> Put method performs update for sysTable.

Let me add. You have not point WHY we need mColumnIndex.

When I have start read this, I have told self:
    Hmm, why we need it?!
    we can get this from position of field in Array.

Few seconds later I have to see why:
    on open we read files in physical order from sys tables,
    then we need sort by that mColumnIndex.

This should be mentioned in Comments, Ivan.
Other people also can wonder why?

 
> 1. DropField in position 2. That means we need update column indexes for all
>    fields which are "after dropped field". This task is performed in the
>    Record_Imp::RemoveField method.
> 
> 2. db.Close() and after that - db.Open(). Here is all database objects are
>    created using info from sysTables. So we have mFields in the Record in
>    systable-saved order. We need to sort this array to be in ColumnIndex
>    order. This task is performed by new method
> 
>    void Record_Imp::SortFields( void ) throw()
> 
>    Test is passed.

Good.

IMPOANRT POINT, 

What about names of Field files ?!!!

Add the next test:

* you must add say 10 records into table with different data in columns.

* after above changes and close/open make sure that you read back the
CORRECT data.

If you will find that data are wrong then problem and solution is next
    (we have discuss it on seminar)

- in the name of embedded field files, must be use Field_ID, but mot Field
Index. Because Field_ID never changes for a field during its life.

Please check this.



-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina-beta mailing list