Page 1 of 1

Diagram Box Expression, FACT ContainsText

Posted: 04 Mar 2022 16:15
by jimlad68
I have a query with
"=FactLabel(%FACT%)",,"contains",TEXT,"JGO"
Works fine.
I am trying to put the same thing into a Diagram Box Expression.
e.g. =ContainsText(FactLabel(%FACT%),"JGO",STD) which does not work.

My current fix is to have a Box condition for each %FACT% but I was hoping there would be a neater way.
e.g. multiple %INDI.EVEN-xxxJGOyyy[1+]%

Alternatively, is there a way to have a list of Boolean OR expresions in 1 condition.

Re: Diagram Box Expression, FACT ContainsText

Posted: 04 Mar 2022 16:56
by tatewise
Yes, %FACT% only has meaning in the context of a fact, i.e. in a Fact Query or in a fact Sentence Template.
It does not know what Fact to refer to in say an Individual Query or a Diagram Box Expression.

Sorry, but there are no wild card or looping index neater solutions that I can think of :(

However, you can have boolean expressions using the =IsTrue(...) function.
e.g.
=IsTrue( Exists(%INDI.EVEN-ABCJGOXYZ%) or Exists(%INDI.EVEN-XYZJGOABC%) or ... )

Re: Diagram Box Expression, FACT ContainsText

Posted: 04 Mar 2022 17:29
by jimlad68
Thanks again Mike, that works a treat, I like a bit of Boolean. I will keep this in place, but in this instance it might be simpler to have multiple conditions, but I am sure I will use the =IsTrue(...) function in the future.

I'm sure it is nothing to worry about with LUA and modern PCs, but I often wonder if lots of nesting/Booleans is more or less efficient than lots of separate commands.

I once created a complex troubleshooting mainframe SQL query (a lot of trial and error), only to be told it was a pain for the on call programmers to understand, and if it was production it would be very inefficient!