main logo
Subject: RE: Sort problems
Author: "Suros, Juan"
Posted: 2001/08/31 18:18:05
 
View Entire Thread
New Search


<<<
What about letting one sort an existing cursor? Would that work? Then
you could do a search on word indexed fields, and then once you have
them have Valentina do a sort on any field, case-insensitive.

We've talked about having Valentina sort an existing cursor before --
maybe this is a good reason to allow it?

Jon
>>>


Here's an idea that may be simpler to implement: Can you make a function
"InStrByWord()" for method fields that can use an 'index by words' type
index to return a boolean value? Like so:


Dim g_vdbProj As VDataBase
Dim tabTemp As VBaseObject
Dim pFirst As VField
Dim pSecond As VField
Dim pTemp As VField
Dim cResult As VCursor

'Given a Table...
Set tabTemp =3D g_vdbProj.CreateBaseObject("Table")

'With some fields...
Set pFirst =3D tabTemp.CreateField("CharField", kV_TypeString, 50)
'c(50)
Set pSecond =3D tabTemp.CreateField("SortField", kV_TypeLong)

'One of which is indexed by words...
pFirst.IndexedByWords =3D True


'... Add some data ...


'Make a method field to indicate fields containing needed word
"Onion"...
Set pTemp =3D tabTemp.CreateField("WordFound", kV_TypeBoolean,,,
"InStrByWord('CharField','Onion')")
pTemp.Indexed =3D True

'Then we can make Jon's required cursor!
Set curTemp =3D g_vdbProj.CreateCursor
curTemp.ExecuteSQL "SELECT * FROM Table WHERE WordFound =3D True ORDER =
BY
SortField"



To work, it must be possible to implement function:

InStrByWord(FieldName As String, WordToFind As String) As Boolean

for method fields that uses an existing Index By Words. Is this
possible?



Juan Suros
Kyocera America, Inc.
 
©2001 Suros, Juan
<-- Prior Message New Search Next Message -->