Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving one record before another?
Message
 
To
10/04/1998 22:05:14
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00091247
Message ID:
00091353
Views:
24
>How can I change the order of records in a non-indexed table so as to move one record before another.
>
>Here's the scenario: When entering step-by-step instructions on a Shop Order (to tell employees the order in which a job should be done), sometimes, you want to go back and add a new step between two existing steps, or after a certain step, or before a certain step. The records are collected in a grid, where a command button on the form does an append, then passes focus to the new record in the grid. How can I allow for re-ordering, without having a field in the table that stores the sequence number?
>
>I need a mover or something.

it is much simpler to have a field dedicated to the item's position in the sequence. This field can be Integer type and takes only 4 bytes.

For reordering the items in the table, I use a form that contains a list box with the MoverBars property set to TRUE.

When adding a new record, I set the sequence nr to max(sequence nr) + 1

hoping this helps
Christian Desbourse ( Belgium )
Previous
Reply
Map
View

Click here to load this message in the networking platform