Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with Buffering
Message
From
21/08/2004 19:06:12
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
21/08/2004 17:26:27
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00935234
Message ID:
00935245
Views:
27
>Thanks for the quick response....
>
>Is there any way to sort the data in the grid, or will I have to try to figure out how to use a cursor?

The code from my previous example:
* Form.Load()
...
use MyTable order "MyIndex"
...
would sort the data according to what is specified in the index MyIndex. An index can have any valid expression.

The grid, of course, is supposed to be bound (Grid.RecourdSource) to the table "MyTable", in the example.

To sort later in another order, according to criteria specified by the user (for instance, when the user double-clicks on a Grid Header), you can create temporary indices, or re-use existing indices.

Temporary indices are created with "TO" instead of "TAG", for example:
indexname = sys(2015)
select MyTable && if it already open
index on LastName to (indexname)
Selecting a filename with sys(2015) will avoid conflicts in multi-user systems (i.e., on a network, or even if the same user opens the same form twice). You will need additional code to delete the index, when you no longer need it.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform