Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter and Indexes Question
Message
 
À
10/03/2003 11:36:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00763370
Message ID:
00763717
Vues:
21
Hi Doug

Thanks for you information. After discussion with Mark and Tracy I was planning to implement something like this.

Simon

>Hi Simon.
>
>>Am I missing something or is this an overlooked feature of the cursoradapter class? It seems to me that it should have an array property of index tags and keys that should be created and managed automatically.
>
>I actually implemented this using the new Collection base class. My SFCursorAdapter class (the parent class for all CursorAdapters I create) creates a collection of indexes:
>
>
This.oTags = createobject('Collection')
>
>The AddTag method adds information about an index to the collection:
>
>
lparameters tcName, ;
>  tcExpr, ;
>  tcFor, ;
>  tcCollate, ;
>  tlDescending, ;
>  tlCandidate
>local loTag
>loTag = createobject('Empty')
>addproperty(loTag, 'Name',          tcName)
>addproperty(loTag, 'Expression',    tcExpr)
>addproperty(loTag, 'ForExpression', tcFor)
>addproperty(loTag, 'Collate',       tcCollate)
>addproperty(loTag, 'Descending',    tlDescending)
>addproperty(loTag, 'Candidate',     tlCandidate)
>This.oTags.Add(loTag, tcName)
>
>Finally, the CreateTags method, called after the cursor has been filled, creates the defined tags:
>
>
local loTag, ;
>  lcTag, ;
>  lcExpr, ;
>  lcFor, ;
>  lcCollate, ;
>  lcDirection, ;
>  lcType
>for each loTag in This.oTags
>  lcTag       = loTag.Name
>  lcExpr      = loTag.Expression
>  lcFor       = iif(empty(loTag.ForExpression), '', ;
>    'for ' + loTag.ForExpression)
>  lcCollate   = iif(empty(loTag.Collate), '', ;
>    'collate ' + loTag.Collate)
>  lcDirection = iif(loTag.Descending, 'descending', 'ascending')
>  lcType      = iif(loTag.Candidate,  'candidate',  '')
>  index on &lcExpr tag &lcTag &lcCollate &lcFor &lcDirection &lcType
>next loTag
>
>Doug
Simon White
dCipher Computing
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform