AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Dynamic label in ^next
 
 

I have captured a rule tag in a variable and I’m attempting to use that variable in something like:

$$next = ^next(rejoinder $$rule)
$
$pat = ^getRule(pattern $$next

But the ^next function always fails.

So I guess my first question is, should I expect it to work? Obviously if I hard code a tag then ^next(rejoinder) works perfectly, but I was intended to use this construct in a macro where the tag name is passed as a parameter.

I have seemingly tried many variations in dynamically constructing the statement and using ^eval() but I’ve not got any of them to work. But I also might be misunderstanding the capabilities of ^eval(). The documentation shows an example of using ^eval() to get a variable value through indirection, but not the arbitrary execution of code. So I may be barking up the wrong tree here.

 

 

 
  [ # 1 ]

CS bug. fixed for next release this weekend

 

 
  [ # 2 ]

Great thanks.

 

 
  [ # 3 ]

CS handles the first ^next() but seems to have trouble with subsequent ones.

I am trying to walk all of the rejoinders of a rule. Say ~mytopic.2

$$_curRule = ^next(REJOINDER %rule)
^
loop(){
    
$$_curRule = ^next(REJOINDER ~)


when I trace the function I am doing this in I see that $$_curRule gets set to ~mytopic.2.1 initially as expected but all of the subsequent calls to ^next(REJOINDER ~) also return ~mytopic.2.1.

the systems function manual says:

If label is ~, it will use the last call’s answer as the starting point, enabling you to walk rules in succession.

Bruce, there may be a bug with the ~

I can walk the rejoinders if I use:

$$_curRule = ^next(REJOINDER %rule)
^
loop(){
    
$$_curRule = ^next(REJOINDER $$_curRule)

 

 

 
  login or register to react
‹‹ CS Security Risk      User bot file trashed ››