Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do not understand INDEX ON
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00183833
Message ID:
00183939
Views:
18
>Good job with the descriptions!

Think yew ...

>I *think* (never occured to me before) that specifying the tables' (already existing) structural CDX file name in the 'OF' clause WILL create a structural tag, as if the 'OF' clause was not used. In *this* case, the file DOES need to be opened exclusively (because it IS a structural tag). In short, I don't think the 'OF' clause *forces* a non-structural tag. So your initial understanding was correct.

Interesting point we made here, and I'd like to hear more on it from those who know more than me! The point being: I'm pretty sure you're right that if you specify the OF clause and specify the structural CDX which is already there, VFP happily adds a TAG to it as if you hadn't specified OF. But it's important that you said "already existing"!

The question is, what if you specify an OF clause with a CDX filename the same as the table name, but the structural CDX didn't exist yet? Does VFP create a non-structural CDX even though you specified the same filename? I think from what Brenda described in her situation, that must be what happened!

One of the few cases in which over-specifying what you want VFP to do can be detrimental. I try to fill in optional clauses and parameters a lot, toward the end of "self-documenting code" (I know, but you can shoot for it!) as well as avoiding ambiguity which could cause bugs later. I usually specify SEEK(value, table, tagname) even when I know I'm seeking in the currently selected table which already has order set to that tagname, because someday someone may put code between the table's setup and my SEEK, which breaks the SEEK if I didn't specify the table and tag.

But here's a case where specifying an optional command parameter apparently caused Brenda a big headache. If I'm right about what happened to her.

Cheers,
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform