Evaluate a boolean Expression within a variable? - Solved

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Evaluate a boolean Expression within a variable? - Solved

Post by DR White » Fri Dec 23, 2022 7:23 pm

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
Last edited by DR White on Fri Dec 23, 2022 8:38 pm, edited 1 time in total.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Evaluate a boolean Expression within a variable?

Post by Klaus » Fri Dec 23, 2022 7:35 pm

So TransposeOutputlogic contains/results in FALSE?

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Evaluate a boolean Expression within a variable?

Post by DR White » Fri Dec 23, 2022 7:37 pm

yes it does

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Evaluate a boolean Expression within a variable?

Post by Klaus » Fri Dec 23, 2022 7:38 pm

I'm not Craig, but here they are:
Bildschirmfoto 2022-12-23 um 19.37.04.png

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Evaluate a boolean Expression within a variable?

Post by Klaus » Fri Dec 23, 2022 7:40 pm

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

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Evaluate a boolean Expression within a variable?

Post by DR White » Fri Dec 23, 2022 8:38 pm

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

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Fri Dec 23, 2022 9:50 pm

AHA! "value", go figure! :D
Thanks for the feedback!

Happy holidays from germany

Klaus

dalkin
Posts: 183
Joined: Wed Jul 04, 2007 2:32 am
Contact:

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

Post by dalkin » Fri Dec 23, 2022 10:02 pm

From the ChatGPT AI engine at https://chat.openai.com/chat
Screenshot 2022-12-24 at 7.57.08 am.jpg
The underlying purpose of Al is to allow wealth to access skill
while removing from the skilled the ability to access wealth.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

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

Post by dunbarx » Sat Dec 24, 2022 9:25 pm

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

Post Reply