Normal Topic xresultsetsearch (Read 1152 times)
olddog
Member
*
Offline



Posts: 35
Joined: Jan 19th, 2008
xresultsetsearch
Jan 27th, 2008 at 4:21am
Print Post Print Post  
is there a way to merge two or more result sets or add existing records to a result set, i saw how to remove records from a result set.  i have a field in my record that may point to another record.what i would like to end up with is a set of records that follows the pointer to each pointed record until it stops pointing.  eg record 10 points to 6. 6 points to 3. 3 point to 2. 2 does not point. set includes 6,3,2. any suggestions?
  

trying to learn a new trick
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: xresultsetsearch
Reply #1 - Jan 27th, 2008 at 5:48am
Print Post Print Post  
It sounds like you are trying to build a linked list inside of a database. Why not use shared information to "join" your records? If any one record may appear in more than one list, use a keyword field to note its inclusion in multiple categories. Use a sorts to establish order within each list. That should get you to about the same place with much less trouble, and it takes advantage of the fact that you have a database on hand.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
olddog
Member
*
Offline



Posts: 35
Joined: Jan 19th, 2008
Re: xresultsetsearch
Reply #2 - Jan 28th, 2008 at 1:25am
Print Post Print Post  
your answer has left me no less confused.  let me explain further. i am working on a to do list (see other post) my record has five fields. 1) priority 3) to categorize and describe the task to be done 1) a pointer to the task that must be completed first,  maybe empty if no prerequisite.  i have created a form (among several) with three section 1) that displays the current record 2) a group of unbound text boxes for the prerequisites and 3) a group of unbound text boxes to display the tasks waiting for the current task to be completed.  i am using the groups of text boxes to display the data in a formatted manner. to get the information for part 3 i am using a xresultsetsearch to find the records whose prerequisite field are equal to the current record.  this part seems to be working fine, although i do keep tweaking it asmy knowledge of this program grows.  i would like to treat part 2 in the same manner as part three if possible, but am open to better ideas.
  

trying to learn a new trick
Back to top
 
IP Logged
 
olddog
Member
*
Offline



Posts: 35
Joined: Jan 19th, 2008
Re: xresultsetsearch
Reply #3 - Jan 28th, 2008 at 1:23pm
Print Post Print Post  
as i think more abo3utthis i wonder will xresultsetsearch work with a string array?
xresultsetsearch(@fn,field,SEARCH_MODE_AND,SEARCH_SYNTAX_QA,"!prereq= 1;3;5")
  

trying to learn a new trick
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: xresultsetsearch
Reply #4 - Jan 28th, 2008 at 1:36pm
Print Post Print Post  
olddog wrote on Jan 28th, 2008 at 1:23pm:
as i think more abo3utthis i wonder will xresultsetsearch work with a string array?
xresultsetsearch(@fn,field,SEARCH_MODE_AND,SEARCH_SYNTAX_QA,"!prereq= 1;3;5")


If you can type 1;3;5 into prereq on a retrieve spec and get what you want, then @XResultSetSearch should also get you what you want with that criteria.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
olddog
Member
*
Offline



Posts: 35
Joined: Jan 19th, 2008
Re: xresultsetsearch
Reply #5 - Jan 30th, 2008 at 2:23am
Print Post Print Post  
found a work around for my needs.  i created a new bound element to keep the prereq's prereqs.  also allowed for multiple prereqs for record.  i then concatenate the two ; delimited string arrays.  i then use this list to find the result set.  seems to work fine.  had not previously considered the multiple prereq scenario, but i think it is an improvement to my original idea.
  

trying to learn a new trick
Back to top
 
IP Logged
 
olddog
Member
*
Offline



Posts: 35
Joined: Jan 19th, 2008
Re: xresultsetsearch
Reply #6 - Jan 30th, 2008 at 4:22am
Print Post Print Post  
can the result set from a xresultsetsearch be  to the first x number of matches or last x number of matches
  

trying to learn a new trick
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: xresultsetsearch
Reply #7 - Jan 30th, 2008 at 12:53pm
Print Post Print Post  
olddog wrote on Jan 30th, 2008 at 4:22am:
can the result set from a xresultsetsearch be  to the first x number of matches or last x number of matches

There is no TOP or LIMIT. However, once you have the result set handle, you can loop from 1 to n to get the first n. You can get the total number of records in the result set and move your result set position to ((total - n) + 1) to get the last n matches.

BTW, re your multiple prereqs, you might want to look into Keyword fields.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged