Best approach?



I've written a function that parses a search string and returns a 1D array
for each word in the string.
Such as, "PAINT SPRAY RED" would return an array of
cArray[1,1]="PAINT"
cArray[2,1]="SPRAY"
etc.
Now I want to issue a SELECT statement to search my inventory file
Select * from inventory WHERE cArray[1,1]$descript AND .... (or several
other fields may be searched) and so on...

The problem is that I can't hard code the select statement because the
function will create the number of elements for the array based on how many
search terms are entered. I'm assuming a user defined function in the
select to return the WHERE clause would work, but is this best? (or is this
even permissable and will a UDF in a Select statement return correct
results?)
What would be the best approach for this?
How do search engines like google parse the search string and then return
the results to a cursor?
Thanks,
John
I'm using VFP8SP1


.



Relevant Pages

  • Re: Tracking key combination
    ... > charactes typed by the user? ... array, make the counter wrap around to the start of the array when it ... Suppose we are looking for the string ABCDE, and the user types xyABCDE: ... (our array is the same size as the search string, ...
    (comp.lang.java)
  • Re: FileListBox
    ... Try Step -1 to go backwards through the list, collection, array, etc... ... the user specifies a search string to ... > find in the filenames along with the string to replace it with. ... > on this, I want to cycle through a FileListBox, looking at each ...
    (microsoft.public.vb.general.discussion)
  • Re: Best way to find if item is in array?
    ... > To ensure that your search string is not embedded try this: ... > This presumes that "|" is not a character in your array. ...
    (comp.lang.javascript)
  • Re: How to search files for text string most efficiently?
    ... >search a directory for all flies that contain that search string AND display ... >They have windows ME, XP and 2000 systems. ... Each directory would be queried so as to load all filenames in one ... Then using that array, get each filename, get and read by OPEN AS ...
    (microsoft.public.dotnet.languages.vb)
  • Re: changing a field without recompiling the record
    ... When gawk first got RS as a regexp and the RT variable, ... RT is a really cool feature, I use it all the time. ... it only parses the record up to the largest field ... neither he needs to access that special array. ...
    (comp.lang.awk)