Cursor.Postion property

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Feb 13 10:01:25 CST 2006


On 2/12/06 4:18 PM, "Erne" <ernestogiannotta at tiscalinet.it> wrote:

Hi Erne,

>>>> Position as Integer The current position in the cursor. You can set or get
>>>> the current position of cursor using this property. The valid range of
>>>> values is from 1 to the RecordCount. When you assign a new value to the
>>>> CurrentPosition, Valentina loads a record from the disk to the memory
>>>> buffer.
>>>> 
>>>> Note: If you try to assign a wrong value then the current record is not
>>>> changed.
>>> 
>>> On V1 in this case the cursor did set to position 0
>>> thus setting the buffer to the like of a blank record
>> 
>> Don't you remember if this was document in v1 ?
>> 
> 
> no, I guess it was undocumented
> 
>>> It was very handy for my purposes, any chances we could revert back
>>> to old behaviour?
>>> 
>>> (guess I know the answer, but giving it a try anyway ;-)
>> 
>> And how you have use that old behavior ?
>> 
> 
> I positioned the cursor to record 0
> (vale would do it for any out of range value passed to the
> Cursor.CurrentPosition function)
> then fill the window fields with blank values but no new record has
> yet been created
> if the user makes some edit the CollectRecord method would check the
> position of the cursor
> if it's 0 then add a new record to the cursor and fill it with user's
> input
> 
> Now I must use an Adding flag in the window to manage it
> 
> well, not a great deal
> Old behaviour was just more cool
> (less code branching)

I not agree I think.

It is best practice to SEPARATE GUI from data storage.

GUI should have own logic to handle dirty fields and other states.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list