Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP6: Change Order of Indexes when using TAG

Status
Not open for further replies.

Ronin999

Programmer
Sep 28, 2001
11
US
Hello,

I have a search form that populates the drop down box by using the tag command. Over development, the indexes for this database have been deleted, changed, recreated, etc. The application is finally ready but I have a problem with the order of the index tags.

When the pulldown is populated, the index tags are in a very strange order. Is it possible to reorder them? I'm not talking about reindexing them, just changing the order that the tag command lists them.

Thanks
 

Either create a new index that meets your requirements or base the rowsource of your combo on a cursor you created that meets your requirements.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
A straightforward way would be to delete all the tags and then recreate them in the desired order.

Jim
 
Thanks for the quick responses. Seems a shame that there's not a way to simply reorder the tags... especially since there is a way in the index screen to drag them to a different order.

I'd really rather not delete them all and redo them. Probably a new table with the tags in it that I want ordered properly is going to be the best solution.

If anyone has a secret suggestion on changing the order though, I'd love to hear it. :)

 

Ronin,

Depends how you populate the combo. If you used RowSourceType of 0, and wrote a few lines of code to loop through the list of tags and AddItem them to the combo, you could set the Sorted property to .T. That would put them in alphabetical order.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Well, I dumped the indexes and recreated them in the order I needed them in. Just out of curiousity, do the newer versions of foxpro allow for changing the order of these?

Thanks for the help.
 
Just out of curiousity, do the newer versions of foxpro allow for changing the order of these?

No, not in 9 anyways. If I need an ascending index I create one, and if I also need a descending I create a second index descending, and I can alternate between both.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Ronin,
Indexes on DBFs are often subject to corruption, so I consider them to be "calculated data". If the index files get damaged (basically detected by a crash with ErrorNo being one related to index file problems, like "Invalid Seek Offset"), my programs automatically re-create all the indexes the next time they are loaded. As a result, the indexes are recreated in the right order (not that it matters to me... the order seems to me to be like Primary Keys should be: The user never should see them!).

If I want to re-create all the indexes in a different order, (as you wanted to above) it's as simple as adjusting the order of the INDEX ON commands in REINDEX.PRG, then launching the program and choosing "Index Data" from the menu.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top