This thread tracks a reported editor issue with the Lua modulo operator in Fairino software v3.9.8.
Status
Known warning with a workaround. It was reported to the manufacturer. Whether 4.0.0-1 fixes it is not confirmed yet.
Symptoms
- A line that uses the
%operator gets a second%added every time the program is saved. - The code changes on save, even if you did not edit that line.
Workaround
Use math.fmod instead of the operator:
-- instead of: local rest = counter % 2
local rest = math.fmod(counter, 2)
If you only need to check set bits, bitwise operations are another option.
Please reply with
- Software version where you see it
- Whether it happens in the WebApp editor, on the teach pendant or both
- Whether your version has fixed it