Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change cursor order without changing cursor recno()
Message
From
10/10/2001 13:38:12
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Change cursor order without changing cursor recno()
Miscellaneous
Thread ID:
00566521
Message ID:
00566521
Views:
52
I have an app that creates a cursor of records from a table, approximately 2000. In the SELECT, I have an ORDER call setting the order. Originally, I thought I needed a READWRITE cursor (don't have VFP 7 though) because I need to have two fields user changeable per record. I ended up creating an Array for the two changeable fields where the "tie" is the RECNO() of the cursor record.

I now need to switch the display order (I use the cursor and array in a grid) from one column to another. The way I did it originally was to re SELECT the cursor and change the ORDER portion. In doing so, the RECNO() of course change.

The client now wants to be able to switch back and forth as often as necessary during each session but wants to KEEP the info in the two array fields with the appropriate records in the cursor. Again, the tie WAS the RECNO() of the cursor record.

I obviously can't call the SELECT again, and am leary of using an INDEX ON command because I don't want to create a temporary file on the hard drive that I have to ensure gets erased... (I originally did all this with a temporary db file and that got problematic and a bit slow, hence the switch to the cursor).

I now am thinking maybe instead of cursor and array, how about just an array with all the field information... that way maybe I can ASORT() the array. I guess I am too novice to think of all the possibilities and potential problems this might ensue switching to just an array. It is alot easier to access a cell element in the grid and code with cMyCursor.MyField as opposed to an array call aMyArr(ThisRecord,ThisField)


Suggestions?
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Next
Reply
Map
View

Click here to load this message in the networking platform