Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with Buffering
Message
De
21/08/2004 19:06:12
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
21/08/2004 17:26:27
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00935234
Message ID:
00935245
Vues:
29
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform