Hello, 

I am using defquery to simulate CLIPS do-for-all-instances over the 
JessTab/Protege environment. The defquery interface demonstrated in the 
Jess manual works perfectly for me, in that I can run my query, create a 
Token object and reference the individual slots of deftemplate-type facts. 
There are several hundred facts that my query returns though, and I would 
like to call some functions that operate on my slots while I iterate 
through all the returned facts. 

for example,

(while (?it hasNext)
..
...
..
(bind ?the-name (fact-slot-value ?fact name))
(bind ?the-condition (fact-slot-value ?fact condition))
(bind ?the-name (nth$ 1 ?the-name))
(bind ?the-condition (implode$ ?the-condition))
(printout fileDescriptor ?the-name)
(bind ?vars (someFunc ?the-condition))
(printFunc ?vars))

I am doing nth$ because I only need the 1st part of the list the-name and 
implode$ because string manipulation functions need to be applied to the-
condition (using someFunc).


Now, I can correctly print the-name to file. However, for some reason, I 
cannot print the results of someFunc using printFunc (the function has 
access to the file descriptor). I know that someFunc and printFunc evaluate 
correctly, and that the output text file contains (at the very end) ONE 
result from the someFunc-printFunc chain. Has this problem been seen before 
at all? Is it because I am receiving list values from my query that this 
fails (for reasons unknown to me)? I know that calling other functions in 
defquery iterations works for a small simulated case (3 query results, no 
multifields returned) and am wondering what I am doing wrong. 

thank you very much for your time and help. 

SAUMIL MEHTA

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to