Logic Machine Forum
Simple Script "less than" help - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Simple Script "less than" help (/showthread.php?tid=1684)



Simple Script "less than" help - Kai-Roger - 31.10.2018

Hi.

There is something wrong with "OUTPUT = false" at the end of the script. I can't find out what i should write instead.

BR
Kai-Roger Kolseth



INPUT-A= grp.getvalue('63/1/1')
INPUT-B = grp.getvalue('6/2/11')
OUTPUT = grp.write('1/0/108')

if INPUT-A < INPUT-B  then OUTPUT = false

end


RE: Simple Script "less than" help - admin - 31.10.2018

Variable names cannot have minus signs in them, because it's a math operator.

Code:
INPUT_A = grp.getvalue('63/1/1')
INPUT_B = grp.getvalue('6/2/11')

if INPUT_A < INPUT_B then
  grp.write('1/0/108', false)
end



RE: Simple Script "less than" help - Kai-Roger - 31.10.2018

(31.10.2018, 13:40)admin Wrote: Variable names cannot have minus signs in them, because it's a math operator.

Code:
INPUT_A = grp.getvalue('63/1/1')
INPUT_B = grp.getvalue('6/2/11')

if INPUT_A < INPUT_B then
 grp.write('1/0/108', false)
end

Sorry. I wrote it wrong in the tread. Should have been INPUT_A and INPUT_B as it is in my script.
The way you write it is working fine, but i want to have the output as a variable. Is that not possible in LUA?


RE: Simple Script "less than" help - admin - 31.10.2018

Can be done like this:
Code:
OUTPUT = grp.find('1/0/108')
OUTPUT:write(false)



RE: Simple Script "less than" help - Kai-Roger - 31.10.2018

Absolutely brilliant  Big Grin Thanks