Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to re-sequence all the records in a table
Message
De
07/10/1997 06:25:08
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapour
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to re-sequence all the records in a table
Divers
Thread ID:
00053490
Message ID:
00053490
Vues:
63
I am trying to implement a simple 'multiple select mover grid' and I find the re-sequencing of the record slow. I am sure there is a way to re-order the records in a shorter time. Can somebody help?

I keep a sequence number in the table to order the table. First, the user selects a few records by clicking on the checkbox (flag). Then the user selects the new position for the selected records. When the 'Move' button is click, I tried to sequence it using the following codes

nrecno = recno()
nseq = sequence
replace all sequence with sequence*1000
replace all sequence with sequence/1000+nseq*1000 for flag=.T.
i=0
scan
i=i+1
replace sequence with i
endscan

The scan is slow. Is it possible to do it in one replace statement?

Can anyone suggest other ways of re-sequencing of records?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform