Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Re-order records with MOVE UP / MOVE DOWN
Message
From
15/11/2000 22:14:14
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/11/2000 09:12:06
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00441438
Message ID:
00442455
Views:
9
>>Please share your your psuedo-code off the top of your head for the MoveUp.click() method....
>
>Um, ok:
>
>
if order > 1 && can't use "not bof()" because of the order tag
>	replace order with order - 1
>	skip -1
>	replace order with order + 1
>	skip
>	thisform.refresh()
>endif
>That should flip flop the record with the previous one if its not the first record.

Not necessarily - when you replace order with order-1, it may come BEFORE the previous record (if order is the active tag). The way I did it back in 2.6 (using OKLs on Ctrl+PgDn and Ctrl+PgUp) was about this:
nCurRec=recno()
nCurOrd=order
skip -1 (or +1 if moving down)
nOtherOrd=order
replace order with nCurOrd
go nCurRec
replace order with nOtherOrd
now do the refresh

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform