This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Simple Script "less than" help
#1
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
Reply
#2
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
Reply
#3
(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?
Reply
#4
Can be done like this:
Code:
OUTPUT = grp.find('1/0/108')
OUTPUT:write(false)
Reply
#5
Absolutely brilliant  Big Grin Thanks
Reply


Forum Jump: