Hey all,
I've been able to write a function that dynamically created variables and stored values.
Code:
(defun GetAndStoreVariables ( / );Get and set variable values for functional stuff
(foreach Pair (SomeVariables)
(set (read (car Pair)) (cdr Pair))
);end foreach
(princ)
);end defun
(defun SomeVariables ( / )
(list (cons "Var1" 123)
(cons "Var2" 456)
(cons "FrameWid" 1200.0)
(cons "StandardSpacing" 100.0)
)
);end defun
Does anybody know if it's possible to dynamically define functions?
I'm currently trying the following:
Code:
(setq Cnt 0)
(while (< (setq Cnt (1+ Cnt)) 10)
(defun (read (strcat "C:" (itoa Cnt))) ( / )
(body of function......)
);end defun
);end while
But I keep getting "Syntax Error".
Any thoughts?