Memo

From Gwen Morse's Wiki
Jump to: navigation, search
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Antti Pietikäinen (heidel@operamail.com)
;; 2005
;;
;; Usage: type "/memo <text>" and it will add text to a memo text file.
;; Type "/memo" and it will print your memo file entries to your screen.
;;
;; Add a line to memo.txt, or show the memos
;;
;; Gwen Morse renamed from /note to /memo and slightly adjusted format
;; to avoid conflict with CrystalMUSH /note code.

/def -F -i memo=\
/if ({#}==0) \
/_echo%;\
/echo -aB MEMOS:%;\
/echo -aB =====%;\
/quote -S /echo - '"memo.txt"%;\
/echo -aB =====%;\
/return%;\
/else \
/let filehandle=$[tfopen("memo.txt","a")]%;\
/if (filehandle != -1) \
/test tfwrite(filehandle,{*})%;\
/echo % Memo added: %{*}%;\
/test tfclose(filehandle)%;\
/endif%;\
/endif