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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Index question

Status
Not open for further replies.

letsgotovegas

Programmer
Feb 3, 2005
19
0
0
US
Hi Folks
I want to open a dbf which I have a cdx file. The cdx file has 2 tagss. raceid and racedate. I want to set the tag to raceid when I open the dbf.

ie: use races tag raceid ??
or
use races tag raceid in races.cdx

Could someone show me the right syntax. I know this seems real basic but the help file is not helping me.

Kind Regards
John

To much of a good thing - is a good thing!
 
John,

It's USE races ORDER raceid

Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
John,

Sorry, I should have checked that the cdx was structural with the dbf (I think that's the correct technical wording!).

If it is, then the syntax I gave you will work. If it isn't (or if you spell the tagname wrong), you'll get a Variable 'RACEID' not found error.

In that case, you would use the syntax USE races ORDER raceid OF races.cdx

Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Instead of

USE Races ORDER raceid

it is oftentimes faster to do

USE Races
SET ORDER TO TAG raceid

This is because when you open the table, VFP moves the record pointer to the first record. In the first example, that could be any of the records in the table. In the second example, the table is opened, the record pointer is positioned at record 1, then the index applied. The record pointer is not moved when the index is applied.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Thanks Stewart and Craig. I programmed in clipper many many years back. I felt like an idiot asking this question. But whats worest is I am going to do a project in VFP 9 and I will have many more questions. It could get scary. I always liked clipper and foxfire I think VFP was called around 1986. But eventually had to start doing windows programming and they used vb at my job. Never could really get them to look at foxpro real hard though. But this project is my own and MS continues to keeps improving VFP so I feel it is safe for the next 10 years at least. Thanks again for the help.

Kind Regards
John

To much of a good thing - is a good thing!
 
John,

Don't get discouraged. A lot of Clipper-heads have made the transition to VFP. You'll soon remember all the basic stuff, which is pretty much the same in both products. As for the rest .... well, you know where to ask.

You said:
foxfire I think VFP was called around 1986

Actually, it was Foxbase, which was a clone of dBASE III Plus. Foxfire is a third-party reporting tool, which is still goind strong.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi John,

well, as Mike said, you're welcome to ask any questions (as stupid as they may seem).

Actually I recently did some c++ again and also had my problems in finding the correct syntax, especially with the pointer stuff (where to use &var, where to use *var?). But I think I got it up and going now again.

You may have a lot to learn as there were many improvements from foxbase to vfp9, but the core xbase commands are still there.

Bye, Olaf.
 
John,

You may want to find a Fox developer close to where you live, or even a user group. While you can post questions here, nothing beats being able to sit down with someone knowledgeable to do a code review, discuss design and architecture, etc.

There are lots of similarities between Clipper and VFP, but there are more differences.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Hi Don

Were deal with thoroughbred race horses. We cover about 125 tracks accross the country and an other 200 worldwide. Lots of data to keep up with. But these days people spend up to 6 million dollars for a yearling. We both deal with horse power here just in a different form.

Kind Regards
John

To much of a good thing - is a good thing!
 
Don,

I must offer you a belated welcome to the forum. I've seen your posts in several threads now.

There are many folk here who have jumped ship from MSDEVAPPS. I guess you are one of them.

Look forward to speaking to you again in the forum.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top