OK, use this:
(if userclick
(vl-remove nil
(setq connames
(list
(if (= toggle1 "1") "name1")
(if (= toggle2 "1") "name2")
;;; (if (= toggle3 "1") "name3")
;;; (if (= toggle4 "1") "name4")
)
)
)
)
Gives you this:
("name1" "name2" "name4")
Okay, I plunk the this into the code and commented out only the lines for toggles 3 & 4. I have not set those toggles yet. I am not getting the return as predicted. See the Variable Watch below.
LOG Watch
CONNAMES = nil
DCL_ID = 1
NAME1 = nil
NAME2 = nil
TOGGLE1 = "1"
TOGGLE2 = "1"
USERCLICK = nil
WHICH_ACTION = 1
Correct me where I go astray in my thinking what this code is attempting to do.
Step one it looks at (= toggle1 "1") and if this is true it returns "name1" to the list that is Setq to the variable connames. If (= toggle1 "0") then returns a nil which eventually is removed from the list by the (vl-remove nil) function. This I understand and follow.
What is the (if userclick) doing? What is it being compared to with IF function?
Oh yeah, why am I getting the results that I am getting?