Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I find position change on change of order
Message
De
20/09/2011 15:43:55
 
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:
01524067
Vues:
48
>>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


Maybe you can just do a SQL-SELECT command with ORDER set instead.
SELECT * FROM your_table ORDER BY your_order INTO CURSOR your_cursor
then you can always use RECNO() for that purpose.
Regards,
Ony
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform