I see the value in the specific order by clause. 
Thanks for the clarification


-----Original Message-----
From: Bill Anderson
Sent: Wednesday, March 04, 2009 4:37 PM

On Mon, Mar 2, 2009 at 1:14 PM, Tracy Pearson <[email protected]> wrote:

> The only way I've seen that successful is ZAP and APPEND FROM then 
> move the record pointer back. Once back you refresh. This all needs to 
> be between LockScreen toggle.
>
> Why not just create a SYS(2015) CDX file you clean up when the cursor 
> is closed? If you CREATE CURSOR from the start, you can create the 
> INDEXes and VFP cleans up the CDX for you.


Well, several reasons.

First of all, clicking on the header doesn't mean I want it sorted by that
field, though it will be sorted on something related to that field.

The ORDER BY clause can have upwards of six fields, which could blow (though
unlikely) the 240 character key limit to an index.

The other, more relevant issue is clicking on the header the second time
flips the order, but like this:

ORDER BY Field1, Field2, Field3 becomes ORDER BY Field1 Desc, Field2,
Field3.

An actual index would have to have the tag be Field1+Field2+Field3 (leave
type conversions out of the equation) -- the opposite is
(Field1+Field2+Field3) DESC, which is not the same thing.

(Zap + Append From + Refresh) -- That's exactly what I was trying to do but
the grid didn't display. If I *suspended* the program, grabbed an object
reference to the grid and did Grid.Refresh(), it displays.

Since I did have it working via SCATTER/GATHER from the temp cursor and not
via the prior paragraph, that got me thinking some more. First, it probably
has nothing to do with BINDEVENTS(), since the "xBasey" mechanism works.

It's my seasoned guess that VFP maintains an internal pointer to each
displayed record in the grid and probably to each record, similar to, but
not the same as RECNO(). That's why the temp cursor SCATTER/ grid cursor
GATHER worked, because this internal pointer wasn't destroyed. The record
was being updated, but the internal pointer wasn't. ZAP/APPEND wipes it out.
Running the command from the command window recreates this internal pointer.

So going along on that line that pointed me to the fact I needed a Requery
of the grid's cursor. I had a routine that did all the dirty work, so I
called that routine and my records display. I'm happy with that solution, so
I'll leave it at that.

Bill


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/000401c99d11$b37872b0$1a6958...@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to