I have forgotten how to append I’m assuming its not write-line but append line could somebody confirm this.
And also
I’m having trouble recording the date variable… I keep getting error bad argument type stringp nil
; Appends usage count by DATE long variable... (setq g(open "C:/ICT/AutoCAD_Architecture_suite_2012/CUSTOM/WOOD Clones/PEN/USSAGELOG.PEN" "w")) (setq MYDATE DATE) (write-line MYDATE g) ; AS ABSOLUTE LAST WE NEED TO CLOSE THE TEXTFILE... (close g) I have the following code snippet I’m trying to append the file named USAGELOG.TXT to record the date of executions
Solved! Go to Solution.
Maybe this change "w" to "a"
(setq g(open "C:/ICT/AutoCAD_Architecture_suite_2012/CUSTOM/WOOD Clones/PEN/USSAGELOG.PEN" "w"))
(setq g(open "C:/ICT/AutoCAD_Architecture_suite_2012/CUSTOM/WOOD Clones/PEN/USSAGELOG.PEN" "a"))
Southie
Changing 'w' to 'a' appends the file instead of overwriting. If you want to append lines in the file you'll have to read the entire file and save them to variables. Then append them with code and write everything back to the file.