Subject Re: Follow Record to New Position
From Mervyn Bick <invalid@invalid.invalid>
Date Tue, 15 Nov 2022 17:45:41 +0200
Newsgroups dbase.getting-started

On 2022/11/15 09:11, Michael Lind wrote:
> Hi all.  There was a menu item in good old dBaseIV "Follow Record To New
> Position" which, when turned off left the cursor on in the position I
> was at instead of taking it to the new indexed location when the indexed
> field value is changed.  I can't find anything in 2019 which does the
> same.  Is there something I can set from the command window to turn off
> follow?
> Any input is greatly appreciated,
> Michael
Nothing is impossible if you don't have to do it yourself. :-)

While the old dBASE IV command is no longer available you may be able to
do something using an instance of the updateSet class.  If you have
Ken's dBASE book you will find some help there.

Copy the records from the main table ordered on the field you intend
editing into a temporary table.

select * from whatever order by a_field SAVE TO temp_whatever

Use this temporary table, without an index, to edit.  When you close the
form use an updateSet object's update() method to write the changes back
into the main table.

To make this work you will need a primary key in the main table with an
index on the primary key.

To write the changes back

q = new query()
q.sql := 'select * from whatever' := true
u = new updateSet()
u.source := 'temp_whatever'
u.destination := q.rowset
u.indexName := 'ID' //This index must exist for the main table
u = null //Not documented but it needs to be done.

This is completely untested so your mileage may vary. :-(