Reply To: Isaac Harned – Here for forms with javascript

  • Liz Larsen

    Member
    October 27, 2022 at 5:57 pm
    Points: 5,232
    Rank: UC2 Brainery Purple Belt UC2 Brainery Purple Belt Rank

    The tapsMask will match either parent or child layers for all the terminal layers. So it’ll match standalone digits up to 99 and it’ll match any of those with child layers, ie 1-1, 1-2, etc… up to 99-99. I did this because I knew all parent or child layers greater than the number of terminals should be off and it was easy to just turn them all off.

    Then the next else if looks for just parent terminal layers (ie 1 or 2 digits only) less than or equal to the number of terminals and turns those on.

    Then the last else if looks for children terminal layers that are less than or equal to the number of taps for that particular parent layer and turns those on, if that fails, turn the rest for that tap off.

    —————————————————————————————-

    The double vertical lines || are indeed an OR test. That first if statement only cares if the first two digits are greater than the number of terminals, so the OR is looking for up to 2 digits only OR 2 digits that come before a “-” dash.

    —————————————————————————————-

    Thank you for commenting the code better than I did. I started to, and then kinda stopped… I make an attempt, but not a very good attempt when it comes to that.