Hallo Cadmium, CADFFM,
Danke für die Hinweise, es funktioniert jetzt so wie ich wollte !
Es lag am schreiben, muß mit prin1 statt mit princ erfolgen dann bleibt ein String auch ein String.
princ displays strings without quotation marks.
prin1 displays strings with quotation marks.
print displays strings with quotation marks and places a blank line
Gruß, Jürgen
Sieht jetzt so aus :
(defun c:read ()
(setq tm (getenv "temp")) ;Temp-Ordner ermitteln
(setq tm (strcat tm "/test.dat"))
(setq m11 "a")
(setq m22 "b")
(setq m33 "c")
(setq ml '())
(setq ml (cons (list 1 m11) ml))
(setq ml (cons (list 2 m22) ml))
(setq ml (cons (list 3 m33) ml))
(princ "\n ")
(princ ml)
(setq fw (open tm "w")) ;Datei schreiben
(prin1 ml fw)
(close fw)
(setq fs (open tm "r")) ;Datei lesen
(setq ml2 (read (read-line fs)))
(close fs)
(princ "\n ")
(princ ml2)
(setq m11 (cadr (assoc 1 ml2)))
(setq m22 (cadr (assoc 2 ml2)))
(setq m33 (cadr (assoc 3 ml2)))
(princ "\n ")
(princ m11)
(princ m22)
(princ m33)
(princ "\n ")
(type m11)
) ;Ende defun
----------www.pc-ideal.de
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP