||Re: Follow Record to New Position
Michael Lind <dBase@Vincams.com>
||Tue, 15 Nov 2022 10:18:36 -0600
On 11/15/2022 9:45 AM, Mervyn Bick wrote:
> 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,
> 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'
> q.active := 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. :-(
Thank you Mervyn. I did a variation of this by copying out the indexed
table to a new dbf, making my edits and then appending it back into my
zapped original. It's always interesting to me, that new versions of
software, while adding great new features, often have removed tried and
true other features.