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..

Question on ^findtext
 
 

It is great to have those word manipulation functions documented. But I need some help in using ^findtext.

The manual does not say what will happen to the offset returned if the substring is not found. It looks like the return is sort of “undefined” according to the test screen.  (No output is generated for that in the testing screen. In my project script it looks like to FAIL the rule calling it…)

So my question is how to catch the condition of “not found”, as I can’t use ^if to test the $$findtext_start variable?.

Thanks for any advice.

Image Attachments
cs_findtext.png
 

 
  [ # 1 ]

findtext fails if not found, so your rule is aborted.

 

 
  [ # 2 ]

Copy that. Thanks for confirming that.

 

 
  login or register to react
‹‹ synonyms      newlines in output ››