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:
00183933
Views:
22
Rich,
Good job with the descriptions!
I think I must explain myself, however. When using the 'OF' clause, I mean specifying a *different* cdxfile name. 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.
Sorry for any confusion! :)
Mark

>>Rich,
>>I wouldn't say you were 'full of it', but if you create a non-structural tag with the 'OF' clause, you don't need the table opened exclusively. I believe it's been this way for many versions. This is the only real advantage of this type.
>>Mark
>
>Er ... ah ... um ... OK, I've picked up my jaw from the floor.
>
>Well, I guess I would never have known about this because I've never used a non-structural CDX file. I've only used structural CDXs (since they became available), and IDXs for "temporary" indices.
>
>If you can create temporary TAGs without having exclusive use of the file, this is indeed useful to know! Maybe I'll stop using IDXs for temporary indices!
>
>This may help Brenda (and others):
>
>INDEX ON [fieldexpr] TO [idxfile] [COMPACT]
>Creates an IDX index file and sets your order to it. An IDX is a file which can only contain one index expression (and all its keys).
>
>INDEX ON [fieldexpr] TAG [tagname]
>Creates a TAG in a structural CDX file. A structural CDX file contains multiple TAGs (index expressions). The term "structural" refers to the fact that the associated DBF contains a link to the CDX in its file header. A DBF can have only one "structural" CDX. If it has one, this CDX is automatically opened and maintained when the DBF is opened.
>
>INDEX ON [fieldexpr] TAG [tagname] OF [cdxfile]
>Creates a TAG in a non-structural CDX file. This is just like a structural CDX file except that the DBF has no link to it, so it isn't automatically opened with the DBF. This type of CDX file must be opened explicitly using SET INDEX or SET ORDER command, or with INDEX or ORDER clause of the USE command, just as IDX files must be.
>
>Anyone who can add to this or correct it, I'd welcome that, of course. Until today, I thought "OF [cdxfile]" still created or used a structural CDX if you specified a file with the same name as the table (except extension, obviously). I don't claim perfect or complete knowledge of Fox...just almost! ;)
>
>P.S. - I didn't mention FOR clauses because I never make filtered indices. Filtered indices are unusable by Rushmore.
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform