Has anyone run into this before?
I'm making a conditional statement for a list, but when I add the 'or' operator, it applies the action to all the values, not just the ones I called in the statement.
I'm starting with this and it works fine:
(start_list "a2") (cond ((= val "0") (add_list "1/8")) ((= val "1") (add_list "1/8")) ((= val "2") (add_list "1/8")(add_list "3/16")(add_list "1/4")) etc... );cond (end_list)
but when I change it to this, it applies the first action to ALL the values and disregards the rest of the statement:
(start_list "a2") (cond (or (= val "0")(= val "1") (add_list "1/8")) ((= val "2") (add_list "1/8")(add_list "3/16")(add_list "1/4")) etc... );cond (end_list)
Solved! Go to Solution.
Solved by dgorsman. Go to Solution.
I think your test condition isn't wrapped correctly. The brackets around the (or...) statment should include the two conditional tests, and there should be another set of parent brackets wrapping the (or...) and the resulting (add_list...) call. Each branch of a (cond...) is effectively a list, with the first element in that list the test to see if the rest of the elements of that list are to be evaluated.