Herman Posted June 11, 2021 Share Posted June 11, 2021 Hello, Sorry I'm here back only to understand / learning something. Before the question a short introduction. In route locking I have also crosses which must be locked. And a static cross doess not have a position. ( unlike a track switch ) Solution : give in the table position 99 to such crosses, so they are handled as another switch, and trap in the code with an if ... then. Works fine Code -- lock the switches, crossings for i, Switch in ipairs(t) do -- a cross without position has in the list/table position 99 if Switch["Position"] ~= 99 then Switch["SwitchPoint"].state = Switch["Position"] end Switch["SwitchPoint"].variables["#TSW Locked"] = true end In a project I forgot to give the crosses the 99 position, they have none as you can see in the table : Route  The code is as above, but even when I looked with the analyser, it seemed there was no script error visible, and I did expect one. And it all works fine ? Is there an error or not, or did I just not seen it ? Do I overlook something ? As always thanks for reading, super thanks for an answer. Kind regards, Herman Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now