Page 1 of 1

Evaluate a boolean Expression within a variable? - Solved

Posted: Fri Dec 23, 2022 7:23 pm
by DR White
I am unable to Evaluate a boolean Expression within a variable.

(Craig, I can't find the code tag)

My code:

The contents of the TransposeOutputlogic is:
InputTable[3] and ((InputTable[0]) or (((InputTable[0]) or (InputTable[0])))) and InputTable[1] and InputTable[2] and InputTable[4]




-------- Does Not Work ----------
Code 1
if TransposeOutputlogic = true then
answer "Yes"
end if



-------- Works ----------
Code 2
if InputTable[3] and ((InputTable[0]) or (((InputTable[0]) or (InputTable[0])))) and InputTable[1] and InputTable[2] and InputTable[4] = true then
answer "Yes"
end if

Why is the Boolean expression within my variable TransposeOutputlogic not working?

Thanks,

David

Re: Evaluate a boolean Expression within a variable?

Posted: Fri Dec 23, 2022 7:35 pm
by Klaus
So TransposeOutputlogic contains/results in FALSE?

Re: Evaluate a boolean Expression within a variable?

Posted: Fri Dec 23, 2022 7:37 pm
by DR White
yes it does

Re: Evaluate a boolean Expression within a variable?

Posted: Fri Dec 23, 2022 7:38 pm
by Klaus
I'm not Craig, but here they are:
Bildschirmfoto 2022-12-23 um 19.37.04.png

Re: Evaluate a boolean Expression within a variable?

Posted: Fri Dec 23, 2022 7:40 pm
by Klaus
DR White wrote:
Fri Dec 23, 2022 7:37 pm
yes it does
Molto misterioso! :shock:

Will have to think about it, but try to resolve all those parens first. :-D

Re: Evaluate a boolean Expression within a variable?

Posted: Fri Dec 23, 2022 8:38 pm
by DR White
I finally got it.


---- Works ----

Code: Select all

   if the value of TransposeOutputlogic = true then
     answer "Yes"
   else
     answer "No"
   end if
I had tried the code below but instead of "Value" I used "Val" and it gave me an error. That is when I reached out for help.

---- Does Not Work ----

Code: Select all

   if the val of TransposeOutputlogic = true then
     answer "Yes"
   else
     answer "No"
   end if

Thanks for everyone's time,

David

Re: Evaluate a boolean Expression within a variable? - Solved

Posted: Fri Dec 23, 2022 9:50 pm
by Klaus
AHA! "value", go figure! :D
Thanks for the feedback!

Happy holidays from germany

Klaus

Re: Evaluate a boolean Expression within a variable? - Solved

Posted: Fri Dec 23, 2022 10:02 pm
by dalkin
From the ChatGPT AI engine at https://chat.openai.com/chat
Screenshot 2022-12-24 at 7.57.08 am.jpg

Re: Evaluate a boolean Expression within a variable? - Solved

Posted: Sat Dec 24, 2022 9:25 pm
by dunbarx
I see that you assumed "val" was a synonym for "value". We see it is not.

LC would have thrown an error, since it interpreted:

Code: Select all

 if the val of TransposeOutputlogic = true then
as if "val" was a custom property of "TransposeOutputlogic". But you cannot assign a custom property to a variable, only to an object.

Craig