Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I find position change on change of order
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01524052
Message ID:
01524068
Vues:
69
This message has been marked as the solution to the initial question of the thread.
>>There's no such thing in VFP as a record position in an index. What do you need it for?
>>
>>
>>>I have a table, with two indexes. (In a cdx file)
>>>
>>>I need to know the new place in the table when the order changes.
>>>ie if it is the second record in the table in sort order #1, what is it
>>>in order #2.
>>>
>>>Let say that in order 1 it is the 2nd record, but in order #2 it would
>>>be the fifth record.
>>>How do I find out when I switch order, what position it's in?
>>>
>>>Can't use recno(), what other functions is there.
>>>Mike
>It's actually a cursor that has two sorts... as stated above.
>
>I then have a control that lists them. (Custom as it is for a touch screen.)
>When I populate the control, I go through the list, using the recno in naming the individual items.
>Thus the 2nd record becomes object #2, when it is orginally sorted. ie the object is object2
>When it is sorted in the other order, it might be object5 (if it is in the fifth position.) however since the recno is 2, my list still thinks its in second place.
>
>I will add a field to the underlying cursor to hold a number independant of the cursor that I will populate after the sorts.
>Thanks,
>mike

Hi,
I would add a field to your table, ID which can be populated autoincr. this will give your items an individual number. I dont think it is good design to work with a reccordnumber as identification. Recordnumber is meaningless.
On the other hand if you change the sequence of your table the recordnumber will remain to be the same. The positionnumber in your table however will change. If you want to work with positionnumber you shall have to renumber each time you change the sequence be means of a scan..endscan.
Work with ID number which is consistent
Regards,
Koen
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform