Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter and Indexes Question
Message
From
10/03/2003 11:36:17
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00763370
Message ID:
00763714
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform