0 Members and 1 Guest are viewing this topic.
(mapcar '(lambda (x) (if (wcmatch (strcase x) "COOLPREFIXHERE:*") (set (read x) nil) ) ) (atoms-family 1) )
If you prefixed all your variables with something to make them different from the rest, you could use something like this to set them to nil:Code: [Select] (mapcar '(lambda (x) (if (wcmatch (strcase x) "COOLPREFIXHERE:*") (set (read x) nil) ) ) (atoms-family 1) )Ron
(defun set_var_nil() (mapcar '(lambda (x) (if (wcmatch (strcase x) "symb_*") (set (read x) nil) ) ) (atoms-family 1) ) )
......... but it didn't work...did i do something wrong?
Quote from: ronjonp on July 10, 2007, 03:11:48 PMIf you prefixed all your variables with something to make them different from the rest, you could use something like this to set them to nil:Code: [Select] (mapcar '(lambda (x) (if (wcmatch (strcase x) "COOLPREFIXHERE:*") (set (read x) nil) ) ) (atoms-family 1) )RonI put this in my codeCode: [Select](defun set_var_nil() (mapcar '(lambda (x) (if (wcmatch (strcase x) "symb_*") (set (read x) nil) ) ) (atoms-family 1) ) )but it didn't work...did i do something wrong?