Is it possible?
I have 5 symbols containing various strings.
I want to replace all the "<" characters with "<" in one, slick expression.
I was thinking of:
(dolist (s (var1 var2 var3 var4 var5))
(replace "<" s "<"))
but it's not working!
Would someone point me in the right direction - please!!
(dolist (s '(var1 var2 var3 var4 var5))
(replace "<" (eval s) "<"))
Thx Ralph!! I'm doing something wrong, because it's still not working for me. I did try your suggestion before posting.
Here the complete test function:
(define (addData)
(set 'formTitle "<abc")
(set 'formDesc "<def")
(set 'formWords "<xyz")
(set 'formEmail "ijkl")
(set 'formURL "<opq")
(set 'data_file "data.txt")
(dolist (s '(formTitle formDesc formWords formEmail formURL))
(replace ("<" s "<"))
(append-file data_file (string formTitle "|" formDesc "|" formWords "|" formEmail "|" formURL "n")))
)
(addURL)
I keep getting:
ERR: value expected in function replace : s
called from user defined function addURL
Where have I blown it?
(eval s)
I haven't tried your (eval s) trick yet.
I solved the issue with:
(define (addData)
(set 'formTitle "<abc")
(set 'formDesc "<def")
(set 'formWords "<xyz")
(set 'formEmail "ijkl")
(set 'formURL "<opq")
(set 'data_file "data.txt")
(set 'data (string formTitle "|" formDesc "|" formWords "|" formEmail "|" formURL))
(replace ("<" data "<")
(println data)
)
(addData)
Thx for your input!!