From: nl0242to@cnplss5.cnps.philips.nl (Oscar van Eijk)
Newsgroups: comp.os.vms
Subject: Agenda.Com; an easy reminder tool (imho:-)
Date: 30 Jul 92 08:21:55 GMT
Organization: Philips Centre For Technology, Eindhoven


----------------------- Start Readme.Txt -----------------

This is Agenda.Com v1.0, a simple tool that may be very handy to
help you remember whatever you want to remember. I wrote it because
I often was working on something, writing a program or whatever, when
it was time to go home or for some other reason I had to stop. What I
did then is send myself a mail to remember where I had stopped. This,
however, is much easier.

I called the tool 'Agenda', not a very well chosen name, 'Reminder' would
be much better, but I had already written another tool which is called
'Reminder'.

To use this is very simple. Just make sure you've got a logical defined
called 'dat:' somwhere in your login. Put a line in your login.com

$ @my_disk:[my_dir]agenda login

and your reminder messages will be shown at every login.
I've also got the next lines in my login:

$ define/key/noecho/nolog/terminate f17 "$@com:agenda read"
$ define/key/noecho/nolog/terminate f18 "$@com:agenda create"

(where 'com:' is a logical pointing to my 'damn-easy-tools'-directory)
So when I have to go due to who-cares-anyway, I just press <f18>, leave a
message to myself and go.

I know more advanced tools like this have been written, but this one's small,
fast, easy to use and easy to modify.

If you like it, let me know. If you don't... well,...forget it.

Oscar van Eijk

---------
 Abandon Hope                                                   Oscar van Eijk
   All Ye                     O x x y                 C&P SON helpdesk, VN-223
Who Enter Here                            Philips Eindhoven, the Net(her)Lands
                                               nl0242t@nlzcl.decnet.philips.nl

------------------------ End Readme.Txt ------------------
----------------------- Start Agenda.Com -----------------
$	set noverify
$	on error then $ goto error_occured
$	on severe_error then $ goto error_occured
$	on control_y then $ goto end
$	goto start
$!
$!******************************************************************************
$!*                                                                            *
$!*  FILENAME:                                                                 *
$!*  =========                                                                 *
$!*     Agenda.Com                                                             *
$!*                                                                            *
$!*  DESCRIPTION:                                                              *
$!*  ============                                                              *
$!*     This procedure creates the facility to make reminder messages          *
$!*     that can be shown at login time. These messages can contain            *
$!*     everything the user wants to be reminded of.                           *
$!*                                                                            *
$!*  LOGICALS NEEDED:                                                          *
$!*  ================                                                          *
$!*     Dat                        Location of the messages                    *
$!*                                                                            *
$!*  PARAMETERS NEEDED:                                                        *
$!*  ==================                                                        *
$!*     P1                         can be: 'login'  - asks if messages have    *
$!*                                                   to be shown              *
$!*                                        'read'   - shows the messages       *
$!*                                        'create' - creates a new message    *
$!*                                                                            *
$!*                                                                            *
$!*  FILES NEEDED:                                                             *
$!*  =============                                                             *
$!*     Msg_%%%%%%%%%%%%%%%.dat    The messages                                *
$!*                                                                            *
$!*  HISTORY:                                                                  *
$!*  ========                                                                  *
$!*     Version:    Date:       Author:                    Changes:            *
$!*     --------    -----       -------                    --------            *
$!*     1.0         10-06-1992  Oscar van Eijk, CompuHelp                      *
$!*                                                                            *
$!******************************************************************************


$!******************************************************************************
$!
$!==>	Check on the parameter.    
$!
$ start:
$!
$	ws  := "write sys$output"
$	cls := "write sys$output ""[2J[1;1H""
$	If p1 .eqs. "LOGIN"  then $ goto checkl_message
$	If p1 .eqs. "READ"  then $ goto checkc_message
$	If p1 .eqs. "CREATE" then $ goto create_message
$	read/end=end/prompt="Read or Create message ? (R/C) : " sys$command act
$	if f$edit(f$extract(0,1,act),"upcase") .eqs. "R" then $ goto checkc_message
$	if f$edit(f$extract(0,1,act),"upcase") .eqs. "C" then $ goto create_message
$	goto start
$!
$!******************************************************************************


$!******************************************************************************
$!
$!==>	At login time there'll always be checked for messages
$!
$ checkl_message:
$!
$	fmsg_counter = 0
$!
$ count_loopl:
$!
$	found = f$search("dat:msg_%%%%%%%%%%%%%%%.dat")
$	if found .eqs. "" then $ goto ask_show
$	fmsg_counter = fmsg_counter + 1
$	goto count_loopl
$!
$!******************************************************************************


$!******************************************************************************
$!
$!==>	Messages are found at login time. Ask if they have to been shown
$!
$ ask_show:
$!
$	if fmsg_counter .eq. 0 then $ goto end
$	if fmsg_counter .eq. 1
$	   then
$		read/end=end/prompt="1 message found, show now ? ([Y]/N) : " sys$command shownow
$	   else
$		read/end=end/prompt="''fmsg_counter' messages found, show now ? ([Y]/N) : " sys$command shownow
$	endif
$	if f$edit(f$extract(0,1,shownow),"upcase") .eqs. "N" then $ goto end
$	goto show_messages
$!
$!******************************************************************************


$!******************************************************************************
$!
$!==>	There was asked to show messages. Check for existance
$!
$ checkc_message:
$!
$	fmsg_counter = 0
$!
$ count_loopc:
$!
$	found = f$search("dat:msg_%%%%%%%%%%%%%%%.dat")
$	if found .eqs. ""
$	   then
$		if fmsg_counter .eq. 0
$		   then
$			ws "No messages found"
$			wait 00:00:01
$			goto end
$		   else
$			found = f$search("reset.dummy")
$			goto show_messages
$		endif
$	endif
$	fmsg_counter = fmsg_counter + 1
$	goto count_loopc
$!
$!******************************************************************************


$!******************************************************************************
$!
$!==>	One ore more messages were found. Show them
$!
$ show_messages:
$!
$	found = f$search("dat:msg_%%%%%%%%%%%%%%%.dat")
$	if found .eqs. "" then $ goto end
$	fmsg_counter = fmsg_counter - 1
$	cls
$	type/page 'found'
$	ws ""
$	ws "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"
$	if fmsg_counter .eq. 0
$	   then
$		read/end=end/prompt="last; Delete message, Edit message, Quit, (D/E/[Q]) : " sys$command act
$	   else
$		read/end=end/prompt="''fmsg_counter' more; Delete message, Edit message, Quit, Next, (D/E/Q/[N]) : " sys$command act
$	endif
$	if f$edit(f$extract(0,1,act),"upcase") .eqs. "D"
$	   then
$		read/end=show_messages/prompt="Do you really want to delete this message ? (Y/[N]) : " sys$command delconf
$		if f$edit(f$extract(0,1,delconf),"upcase") .eqs. "Y" then -
		   $delete/nolog/noconfirm 'found'
$		goto show_messages
$	endif
$	if f$edit(f$extract(0,1,act),"upcase") .eqs. "E"
$	   then
$		assign TT: sys$input
$		edit/tpu 'found'
$		mess_off
$		purge/noconfirm/nolog/keep=1 dat:msg_%%%%%%%%%%%%%%%.dat
$		mess_on
$		goto show_messages
$	endif
$	if f$edit(f$extract(0,1,act),"upcase") .eqs. "Q" then $ goto end
$	goto show_messages
$!
$!******************************************************************************


$!******************************************************************************
$!
$!==>	Create a new message
$!
$ create_message:
$!
$	fn_extract = "''f$extrac(0,2,f$time())'''f$extrac(3,3,f$time())'" + -
                     "''f$extrac(9,2,f$time())'''f$extrac(12,2,f$time())'" + -
                     "''f$extrac(15,2,f$time())'''f$extrac(18,2,f$time())'" + -
                     "''f$extrac(21,2,f$time())'"
$	if f$extract(0,1,fn_extract) .eqs. " " then -
	   $ fn_extract[0,1] := "0"
$	assign TT: sys$input
$	edit/tpu dat:msg_'fn_extract'.dat
$	goto end
$!
$!******************************************************************************


$!******************************************************************************
$!
$!==>	Something weird happened. A message of the error will be displayed
$!	after which the program exits
$!
$ error_occured:
$!
$	error_status  = "''$status'"
$	error_message = f$message('error_status')
$	on error then $ continue
$	cls
$	ws ""
$	ws " *** ERROR ***  Some Undefined Error Occured."
$	ws ""
$	ws "-- Status  was  : ''error_status'"
$	ws "-- Message was  : ''error_message'"
$	exit
$!
$!******************************************************************************



$!******************************************************************************
$!
$!==>	Well, try to guess what's gonna happen... :-)
$!
$ end:
$!
$	cls
$	exit
$!
$!******************************************************************************
------------------------ End Agenda.Com ------------------
-- 
 Abandon Hope                                                   Oscar van Eijk
   All Ye                     O x x y                 C&P SON helpdesk, VN-223
Who Enter Here                            Philips Eindhoven, the Net(her)Lands
                                               nl0242t@nlzcl.decnet.philips.nl