RosettaCodeData/Task/Take-notes-on-the-command-line/Icon/take-notes-on-the-command-line.icon
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

20 lines
590 B
Text

procedure write_out_notes (filename)
file := open (filename, "rt") | stop ("no notes file yet")
every write (!file)
end
procedure add_to_notes (filename, strs)
file := open (filename, "at") | # append to file if it exists
open (filename, "cat") | # create the file if not there
stop ("unable to open " || filename)
writes (file, ctime(&now) || "\n\t")
every writes (file, !strs || " ")
write (file, "")
end
procedure main (args)
notes_file := "notes.txt"
if *args = 0
then write_out_notes (notes_file)
else add_to_notes (notes_file, args)
end