[VSDK] VDK_Cursor Questions

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Nov 12 10:39:12 CST 2003


on 11/11/03 10:20 PM, Eric Forget at forgete at cafederic.com wrote:

>> Try describe your task to us.
> 
> OK. I display the list of the "Name" field of for all the records of a
> table. This list is sorted by Name. This list may be filtered with a search
> field à la iTunes.
> 
> Beside, I have a record editor, to edit all the fields of the selected
> record (from the list). One of the field to be editable is the Name. If the
> user change the Name, the list need to be updated an resorted. The editor
> must stay on the same record, so the list need to still select the same
> record after the sort, but possibly at a different index.

Okay,

1) So user specify NewName
You must save it in var

Cursor must have field RecID also
You store current recId also

2) you rebuild cursor

3) now you can easy and fast locate by binary search group of records that
have NewName value.

And inside of this small group you iterate to find saved RecID.


> Right now, I have a VDK_Cursor initialize with the SQL query:
> 
>   sprintf(query, "SELECT RecID FROM MyTable WHERE RecID = RecID %s ORDER
> BY Name", filterString);
> 
> filterString is either empty or equal to:
> 
>   sprintf(filterString, "AND Name LIKE '%s' no_case", newFilterString");
> 
> The only problem I have is when the user the Name. I need to go through the
> whole new cursor to find the index position of the selected MyTable RecID.

-- 
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 mailing list