Program generated logic statements? - 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

Program generated logic statements? - Solved

Post by DR White » Sun Jul 19, 2020 9:10 pm

I attached a very simple example of what I am trying to do.

I am trying to write a program which generates logic statements.
But, after several hours, I have had no progress.

Maybe someone can help?

Thanks,

David
Attachments
Test_1ZA.livecode.zip
(1.53 KiB) Downloaded 207 times
Last edited by DR White on Sun Jul 19, 2020 10:53 pm, edited 1 time in total.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Program generated logic statements?

Post by bn » Sun Jul 19, 2020 10:09 pm

Hi David,

I tried this with merge. Maybe that works for you. And maybe there are easier ways of doing this.

(I moved the scriptLocal variable into the handler for testing reasons so I have no remnants from previous runs)

Code: Select all

on mouseDown pButtonNumber
   local MasterLogic, MasterLogicTest
   put ("[[" & "i41_00" & "]]" & " and " &  "[[" & "i51_01" & "]]") into MasterLogic 
   put "true" into i41_00
   put "false" into i51_01
   
   put merge(MasterLogic)into MasterLogicTest
   
   -- test MasterLogic for a true ststement, as varables i41_00 and i51_01 change 
   -- But, the contents of MasterLogic which is ("i41_00" & " and " & "i51_01") must not change
   
   put the value of MasterLogicTest into temp -- temp contains logical value
   
   
   --- just a stop point to check value of MasterLogicTest
   put 1 into x
   
end mouseDown
Kind regards
Bernd

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

Re: Program generated logic statements?

Post by DR White » Sun Jul 19, 2020 10:53 pm

Bernd,

That works GREAT!!

I thought there was a function like "merge", but I did not know the name of the function and could not find that type of function in the dictionary.

The LC forum is the BEST,

David

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Program generated logic statements? - Solved

Post by bn » Sun Jul 19, 2020 11:02 pm

Thanks David,

I just simplified "MasterLogic". I don't use merge often and I made it too complicated.

Code: Select all

put "[[i41_00]] and [[i51_01]]" into Masterlogic
Works just as well and is a lot easier.

Kind regards
Bernd

Post Reply