我嘗試了所有選項來在我的輸出文件中創建一個新行,但仍然得到一個txt文件,其中包含以前信息的所有內容。即使有這種supersimple代碼:NetLogo:輸出文件中的換行符?沒那麼簡單。
全局[文件]
to setup clear-all
set file "results\\GA1.txt" if is-string? file
[while [file-exists? file]
[set file replace-item (length file - 5) file "11" ]
file-open file] end
to go tick write-to-file end
to write-to-file file-print (word ticks) FILE-TYPE "\n" file-write 1 file-print (word " " 2 ";") file-write 1 file-print (word " " 2 ";") file-print "" ;; blank line end
我不明白的空白行或換行。我在NetLogo 4.1中工作。有人知道可能是什麼問題嗎?
雅虎阻止用戶沒有一個帳戶,最好在這裏補充答案直接 – tong 2014-07-15 15:42:06
@tong : 好點子。替換爲同一帖子的Nabble網址 – 2014-07-15 18:37:45