Thank you. I am encountering another issue with output files with to go. I want to add data to a file on each tick.
This is the setup code in 6.4
if (file-exists? "speciesgrowth.csv")
[file-delete "speciesgrowth.csv"]
ifelse count turtles = 0 [ ]
[file-open "speciesgrowth.csv"
file-type "time,"
file-type "N3,"
file-type "N4,"
file-print "N5"
ask one-of turtles
[
file-type (word ticks ",")
file-type (word count species3 ",")
file-type (word count species4 ",")
file-print count species5
]
file-close
]
This is the go code
file-open "speciesgrowth.csv"
file-type (word ticks ",")
file-type (word count species3 ",")
file-type (word count species4 ",")
file-print count species5
file-close
This produces an outfile with four columns with headers time, N3, N4, and N5 and fills in the ticks and the numbers of each until go is clicked to stop.
In 7.0, I just get the last tick in the output file and nothing else - no headers - no other tick data. I tried several things and can get the column headers and some data, but the table doesn’t fill entirely - if there are 1000 ticks in the run, it stops are tick ~900.
Setup code in 7.0 to get headers and some data - can’t quite figure if I need to close something
if (file-exists? "speciesgrowth.csv")
[file-close file-delete "speciesgrowth.csv"]
file-open "speciesgrowth.csv"
file-type "time,"
file-type "N3,"
file-type "N4"
file-print "N5"
Go code
ifelse count turtles = 0 [ ]
[file-open "speciesgrowth.csv"
ask one-of turtles
[
file-type (word ticks ",")
file-type (count species3 ",")
file-type (count species4 ",")
file-print count species5
]
]
Any ideas would be appreciated