RosettaCodeData/Task/Take-notes-on-the-command-line/Icon/take-notes-on-the-command-line.icon
2023-07-01 13:44:08 -04: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