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