to create-list-all-year-precipitation
file-open "PCPyear.txt"
let Y 2002
while [Y <= 2017]
[
let line file-read-skipComments
set list-all-year-precipitation lput (item 0 read-from-string item 1 line ) list-all-year-precipitation
set Y Y + 1
]
file-close
end
to-report file-read-skipComments
let rep []
while [(not file-at-end?) and (empty? rep)] [
let line file-read-line
if(length line > 0) [
if ((first line != ";") and (first line != "#") and (first line != "%")) [
if (position " " line != false) [
set rep (list (substring line 0 (position " " line)) (substring line ((position " " line) + 1) (length line)))
]
]
]
]
report rep
end
LPUT expected input to be a list but got the number 0 instead.