T.R | Title | User | Personal Name | Date | Lines |
---|
73.1 | way cool! | EUCLID::OWEN | In a Locst wind coms a RATTLE AND HUM | Thu Apr 06 1989 16:57 | 3 |
| Thanks. Great file!
Steve O
|
73.2 | Disney COM with a bit of flare ! | GENRAL::HIMES | Close Encounters of the Disk Kind | Fri Apr 07 1989 08:26 | 135 |
|
For those of you that wish to have "fun" with your screen, I have
taken Claude's DISNEY.COM (great little routine Claude) and added
some routines and symbol calls to allow you to customize how your
messages display (bold, blink, reverse video, combo of these etc.)
All you need to do is locate the message write commands (Write
SYS$OUTPUT) and add the terms BOLD, BLINK, REVERSE, etc prior to
the message write commands. Don't forget to turn off the attributes
after the message using OFF.
I've enclosed my "updated version" of the DISNEY.HRD for anyone
to experiment or use as I did. (hope you didn't mind Claude 8-)
Mark, who-likes-a-little-flare-on-his-screen-when-it-comes-to-DISNEY
--------------------------------------------------------------------------
$!DISNEY.COM by Claude Berube
$!with code borrowed from Eric Osman's date/time subtract routine
$!
$! Routines added to provide screen highlighting, Mark Himes 7-Apr-89
$!
$!
$ ANSI[0,31]=%X00003C1B ! esc <
$ WRITE SYS$OUTPUT ANSI
$ !
$ ! Screen-Clear Setup
$ !
$ CLR1[0,31]=%X3B305B1B ! esc [ 0 ;
$ CLR2[0,31]=%X5B1B4830 ! 0 H esc [
$ CLR3[0,31]=%X00004A32 ! 2 J
$ CLEAR := "WRITE SYS$OUTPUT CLR1,CLR2,CLR3"
$ !
$ !*******************************************************************
$ !
$ ! High-lighting Setup
$ !
$ UP[0,31]=%X41315B1B ! esc [ 1 A Up a line
$ OF[0,31]=%X6D305B1B ! esc [ 0 m Off
$ BO[0,31]=%X6D315B1B ! esc [ 1 m Bold
$ UN[0,31]=%X6D345B1B ! esc [ 4 m Underline
$ BL[0,31]=%X6D355B1B ! esc [ 5 m Blink
$ RV[0,31]=%X6D375B1B ! esc [ 7 m Reverse video
$ FF[0,7]=%X0C ! Form Feed
$ OFF := "WRITE SYS$OUTPUT OF"
$ BOLD := "WRITE SYS$OUTPUT BO"
$ UNDERLINE := "WRITE SYS$OUTPUT UN"
$ BLINK := "WRITE SYS$OUTPUT BL"
$ REVERSE := "WRITE SYS$OUTPUT RV"
$ !
$ SAV[0,31]=%X0000371B ! esc 7 save cursor
$ RES[0,31]=%X0000381B ! esc 8 restore cursor
$ SAVE_CUR := "WRITE SYS$OUTPUT SAV"
$ RESTORE_CUR := "WRITE SYS$OUTPUT RES"
$ !
$ !
$ c = "comparison"
$ TODAYS_DATE=f$ti ()
$ if f$ext(0,1,TODAYS_DATE).eqs." " then DATE_STAMP="0"+f$ext(1,99,TODAYS_DATE)
$ DATE_STAMP=f$elem(0, "-", DATE_STAMP)+f$elem(1, "-", DATE_STAMP)
$!
$!open data file, change SYS$LOGIN: to your disk/account
$ open DISNEY_FILE SYS$LOGIN:DISNEY.DAT
$!
$!read first line from DISNEY.DAT for arrival date
$ read/end_of_file=DISNEY_EXIT DISNEY_FILE DISNEY_RD
$ gosub TIME_CHECK
$!
$!check for important dates etc.
$LOOP:
$ read/end_of_file=DISNEY_EXIT DISNEY_FILE DISNEY_RD
$ DISNEY_DATE=f$ed(f$ext(0,5,DISNEY_RD),"UPCASE")
$ if DISNEY_DATE.nes.DATE_STAMP then goto LOOP
$ DISNEY_MSG=f$ext(6,75,DISNEY_RD)
$ REVERSE
$ write sys$output "''DISNEY_MSG'"
$ OFF
$ goto LOOP
$!
$!Finish up
$DISNEY_EXIT:
$ close DISNEY_FILE
$ exit
$TIME_CHECK:
$!
$! Normalize sd to smaller than ld.
$ sd = f$cvtime (TODAYS_DATE, "absolute")
$ ld = f$cvtime (DISNEY_RD, "absolute")
$ swap_flag = 0
$ if f$cvtime (sd, "comparison") .les. f$cvtime (ld, "comparison") then -
goto no_swap
$ swap_flag = 1
$ t = sd
$ sd = ld
$ ld = t
$ no_swap:
$! Define internal variables.
$ ldc = f$cvtime (ld, c)
$ flow = 0
$! Calculate answer to nearest day.
$ l = 10000
$ form = "!AS- 0:0:0.0"
$ goto zero_in
$ r1: days = t+1
$! Output the answer.
$ CLEAR
$ BOLD
$ REVERSE
$ BLINK
$ write sys$output "''days' days 'till WALT DISNEY WORLD and counting"
$ OFF
$ return
$!
$! Subroutine to zero in, given ranges and a form.
$!
$ zero_in: s = -1
$ new_t = (s + l) / 2
$ try_value: t = new_t
$ if f$cvtime (sd + "+''f$fao (form, f$string (t))'", c) .les. ldc then -
goto try_larger_value
$ new_t = (t + s) / 2
$ if new_t .eq. t then goto value_done
$ l = t
$ goto try_value
$ try_larger_value: new_t = (t + l) / 2
$ if new_t .eq. t then goto value_done
$ s = t
$ goto try_value
$ value_done: sd = f$cvtime (sd + "+''f$fao (form, f$string (t))'", "absolute")
$ flow = flow + 1
$ goto r'flow
|
73.3 | please send me your ideas | ATE012::CLAUDE | Claude G. Berube | Fri Apr 07 1989 08:47 | 10 |
| Mark,
Thanks for the update, but I'm thinking of add some more stuff, that
would allow you to track not only your Disney vacation but other
vacations as well, using the same .dat file etc.
So if anyone has some Ideas as to what they would like to see, and if
it doesn't make the code that big etc, I'll probably incoporate it.
Claude_1114_days_'till_Disney_Vacation_and_Counting_:^)
|
73.4 | scanned attraction images in decw$clock | TOHOKU::TAYLOR | | Sat Apr 08 1989 15:53 | 5 |
| I want to scan in all the attractions, associate one to each day, and
display the scanned image with decw$clock.
mike
(Of course I would scan images I had bought and paid for.)
|
73.5 | A little out of my league I'm afraid | ATE012::CLAUDE | Claude G. Berube | Mon Apr 10 1989 08:53 | 14 |
| rep to <<< Note 73.10 by TOHOKU::TAYLOR >>>
> -< scanned attraction images in decw$clock >-
> I want to scan in all the attractions, associate one to each day, and
> display the scanned image with decw$clock.
Mike,
Your Joking right? First off I'm not a programer, I'm a Hardware
person in background who just happens to dabble in DCL. As I said in
.0 this was a simple little routine, I'd hate to see what would be
involve to create and display these image in DECWindows.
Claude
|
73.6 | another use for VACATION.COM, revised | SALEM::BERUBE_C | Good Morning WDW!, in 275 days | Wed Jul 24 1991 13:18 | 90 |
| To all,
At a request from Mike Scopa, I'm entering the info here on how I
change my Notes personal name, based on output from my VACATION.COM
file on a daily basis. (which I recieved help from Len btw)
First off, let me explain that I do certain things in my LOGIN.COM file
the first time I log in each day, by comparing todays date to the date
of a zero block file called LOGIN.DAT, if not the same then execute the
special once a day items.
Second, I also have a NOTES$COMMAND.TEMPLATE file with all my main
notes customization stuff, that LOGIN.COM will copy to
NOTES$COMMAND.TPU and append with the special DISNEY stuff. If you
don't have your own special file, you can easily modify the code
accordingly for just the Disney section see below for details.
Claude
PS. note you will need the latest version found in the previous reply
for this to work. Also if you use VACATION.COM for listing other
vacations etc. than either use the special feature to point to a
different VACATION.DAT file that is just Disney related or put the
Disney info as the last item in your main VACATION.DAT file.
Also you will have to keep deleting the LOGIN.DAT file in your
SYS$LOGIN until you get your personal name right.
from my login.com file....(you DCL/TPU hackers should get the idea)
.
.
$!CHECK FOR FIRST LOGIN OF THE DAY
$ if f$ext(0,11,f$time()).eqs.f$ext(0,11,f$file("sys$login:login.dat","cdt")) -
then goto NOT_FIRST
$FIRST_LOGIN:
$!
$!place string of commands you want for first time you log in here
$!
$ VACATION
$ delete sys$login:login.dat;
$ open/write file_out sys$login:login.dat
$ close file_out
$!
$! define com_file sys$output
!$
$ days='days
$ delete/nolog sys$login:notes$command.tpu;
$!
$!do the next 2 lines if you have your own special notes$command.template file
$!
$ copy/nolog sys$login:notes$command.template sys$login:*.tpu
$ open/append/error=done com_file sys$login:notes$command.tpu
$!
$!do the next line for Disney section only
$!
$ open/write/error=done com_file sys$login:notes$command.tpu
$ write com_file "procedure notes$user_open_notefile"
$ write com_file " if notes$x_entry_name = ""DISNEY"" then "
$!
$!change the personal name accordingly in the write command below
$!
$ write com_file -
" notes$do_command('SET PRO/PER=""Good Morning WDW!, in "'days'" days""/temp');"
$ write com_file " endif;"
$ write com_file ""
$ write com_file "endprocedure"
$ write com_file ""
$ write com_file "procedure notes$user_close_notefile"
$ write com_file " if notes$x_entry_name = ""DISNEY"" then "
$ write com_file " notes$do_command(cj_old_pen_name);"
$ write com_file " endif;"
$ write com_file "endprocedure"
$ write com_file ""
$ write com_file -
"cj_old_pen_name:='set prof/temp/pers=""'+notes$x_user_pen_name+'""';"
$!
$!the next line was needed for closing my special template file
$!
$ write com_file " MODELESS_DEFINE_KEYS;"
$ close com_file
$DONE:
.
.
.
$NOT_FIRST:
.
|
73.7 | latest version/bug fixed | SALEM::BERUBE_C | Good Morning WDW!, in 263 days | Wed Aug 07 1991 10:10 | 561 |
| Opps,
I have deleted my original .12 I had entered last Monday, due to a bug
in the code when doing a BRief command. Below please find the updated
text/explanations and .COM file. (NOTE I didn't up the version number
since I didn't add any functionality and caught the bug early, Sorry
Mike/Len I won't be adding Jessica's picture ;^))
Claude
------
Well due to a request from a fellow Moderator who was/is still using an
old version of VACATION.COM, one which didn't display the hh:mm:ss
remaining, but wanted to use the latest version for some of it's new
capabilities and still not display the hh:mm:ss I have added the BRief
command, ie
VACATION BR
which will just print out the number of days remaining, without the
hh:mm:ss format.
I must forwarn you that the output number of days, may be slightly
different (off by 1), when using either the normal default output of
the latest version (hh::mm:ss remaining) or the BRief command. The
reason for this is that the more recent versions of VACATION.COM
assumed VACATION.DAT contains countdown lines in the following format,
*dd-mon-yyyy hh:mm:sscxxx... <- this is the countdown line format
Where position 1 '*' specifies a countdown line, positions 2-21
'dd-mon-yyyy hh:mm:ss' contains the date/time info (this is now ignored
if using BRief command), position 22 'c' is unused at this time and
positions 23-73 'xxx...' is the countdown message to be displayed.
(NOTE: if hh:mm:ss is blank VACATION.COM will assume a value of
00:00:00 in default mode).
So when using the default output of VACATION.COM it will compare the
current 'SYSTEM DATE/TIME OF DAY' combination to the 'DATE/TIME OF DAY'
combination stored in VACATION.DAT and divide the diference by 24, and
display the number of whole 24 hour periods as Days with the remainder
as hh:mm:ss (remainder having been divided by 60 for hh:mm:ss).
When you specify the BRief command to disable the use of hh:mm:ss,
VACATION.COM will display the number of days left, by comparing the
current 'SYSTEM DATE' to the 'DATE' stored in VACATION.DAT (whether or
not you use the hh:mm:ss field in VACATION.DAT) and assign a value of
'00:00:00' for hh:mm:ss to the current 'SYSTEM DATE' and 'DATE' stored
in VACATION.DAT. VACATION.COM will then divide the difference by 24,
in order to have the number of whole Days with no remainder. The
reason for this was that in V1.5 I had not provided a way to specify
the time leaving just the date you were going on vacation. (does that
all make sense?).
So if you to have been using V1.5 or earlier because of it simplicity
in output but wanted to have the ability to bypass VACATION.DAT or
specify a different data file, change your personal name etc. The best
way to get started is to extract this file as VACATION.COM, edit it to
get rid of this first part to include the CUT HERE line below. Rename
your current VACATION.DAT to VACATION.OLD. Invoke VACATION.COM with
the Edit command ie.
VACATION E
and let it make a new dummy file for you, so you can see the new
format, then call in VACATION.OLD and make the necessary changes base
on the new format etc.
Have fun.
********VACATION.COM CUT HERE***********************
$ goto START_PROGRAM !skip comments
VACATION.COM by Claude SALEM::BERUBE_C
with code borrowed from Eric Osman's date/time subtract
routine which was published in UKCSSE::COMMAND_PROCEDURES
notes file, note 58.15
This .COM file uses a User supplied ASCII file called VACATION.DAT (see below
for details on VACATION.DAT). VACATION.COM will remind you of the number of
days, hours, minutes and seconds 'till a vacation as well as remind you of
important dates surrounding a vacation.
Define the following in your LOGIN.COM
$ VACATION:==@yourdisk:[youraccount]VACATION
If you wish to have your VACATION.DAT contained in another directory other
than SYS$LOGIN, define the following in LOGIN.COM
$ VAC$DIR == "yourdisk:[youraccount]"
If you wish to use your favorite editor, other than the default TPU, then
define the symbol VAC$EDIT in your LOGIN.COM, for example to use SEDT as your
editor define VAC$EDIT as follows
$ VAC$EDIT == "$SEDT$LIBRARY:SEDT"
Then type
VACATION ?
for online help on the use of VACATION.COM and it's associated commands
VACATION.COM reads a user supplied ascii text file called VACATION ( or
the user may specify a different file other than the default VACATION.DAT, do
a VACATION ? for details) which contains lines in the following 2 formats.
*dd-mon-yyyy hh:mm:sscxxx... <- this is the countdown line format
_dd-mon-yyyy cxxx... <- this is the reminder line format
COUNTDOWN LINES,
the 1st character of a countdown line, must contain the character *, this
tells VACATION.COM to display the numbers of days, hours, minutes and seconds
left for a given upcoming vacation, based on characters #2 thru 21 which is
the upcoming date/time field that VACATION.COM will compare today's date to
and tell you the remainding days/hours/minutes/seconds left. Characters #2
thru 21 must be in the following format dd-mmm-yyyy hh:mm:ss (ie.
02-JUL-1989 12:30:00). Character #22 on the countdown field is unsused at
this time. Starting at character #23 on, the remainder of the countdown line
is the message to be display with the count (max of 50 characters in lenght,
this is so it'll display correctly on a 80 column display).
REMINDER LINES,
The 1st character of a Reminder line, must contain the character _, this
tells VACATION.COM, that the remainder of the line is to be used for
reminders based on the date field (character #2 thru 12 of the reminder line
NOTE characters 13-21 are unused at his time) and the reminder symbol
(character #22 of the reminder line). Characters #2 thru 12 is used for the
date you wish to be reminded of an activity, and must be in the dd-mmm-yyyy
format (ie. 02-JUL-1989). (NOTE characters 13-21 are unused and should be
blanks) Charater #22 on a reminder line must be one of the following symbols
@ = Print this reminder message only on this date only
+ = Print this reminder message on this date and the 7 days
following this date.(this is good for reminder yourself on the
earliest date in wish to make a certain dinner reservation etc)
- = Print this reminder message on this date and the preceding 7
days prior to this date. (this is good for reminding you of a
due date for payment etc)
Character #23 on, the remainder of the reminder line is reserved for the
reminder message (max of 50 characters in lenght)
NOTE it is recommended to use the 'Edit' command option when you invoke for
the first time, since VACATION.COM will create a Sample VACATION.DAT file for
you, that you can then Delete or Modify to your own requirements
------- SAMPLE VACATION.DAT I THINK YOU GET THE IDEA ----------
*30-NOV-1989 12:30:00 Sample Countdown message (DELETE OR MODIFY THESE 4 LINES)
_30-NOV-1989 @Sample Reminder for this Date
_30-NOV-1989 -Sample Reminder for Today and 7 days prior
_30-NOV-1989 +Sample Reminder for Today and 7 days after
Revision history:
6-APR-89 V1.0 Initial DISNEY.COM Release, actually coded in '86 but forget
the date
6-APR-89 V1.1 Added Eric Osmon's code to make Disney.Com run faster, and
have Disney.Dat contain less data
7-APR-89 V1.2 Added BOld/BLink etc. commands, added feature to prompt upto
7 days prior/after reminder date, renamed files to
VACATION.COM and VACATION.DAT
10-APR-89 V1.3 Fixes bug with DATE_STAMP
17-APR-89 V1.4 Fixed a few logic bugs, eliminate the printing of old data
27-NOV-89 V1.5 Added the Purge command to purge old data in VACATION.DAT,
also added the ? and H command for help message, and
intructions on use at end of file
30-NOV-89 V1.6 Fixed logic for determining command parser, allow for minimum
number of characters to be typed, added command Edit to allow
users to edit VACATION.DAT from within VACATION.COM, added
symbol VAC$EDIT to specify editor to use, also create a
sample VACATION.DAT file when not found, when doing a
VACATION Edit command
08-MAR-90 V1.7 Added logic to display the remaining hours/minutes/seconds in
addition to days. This feature is not used on reminder lines
at this time.
07-FEB-91 V1.8 Added Date command, to accept P2 as the countdown date to
compare today's date to, thereby bypassing the need for a
VACATION.DAT file, useful when first planning a vacation,
must be in the format of dd-mmm-yyy or "dd-mmm-yyy hh:mm:ss".
Also edited help message to point to my new node.
01-JUN-91 V1.9 Added File command, to force VACATION.COM to use another file
other than VACATION.DAT, assumes file is located in the
directory pointed to by the VAC$DIR symbol (default is
SYS$LOGIN). Added the assigning of symbol DAYS for use by
other procedures, this symbol will contain the number of Days
left prior to the LAST vacation listed in VACATION.DAT or
file specified at the completion of VACATION.COM execution.
07-JUL-91 V1.10 Added the BRief Command, this will cause VACATION.COM to not
display the HH:MM:SS left.
$START_PROGRAM:
$ gosub SETUP
$ if f$ed(P1,"upcase").eqs."?".or.f$ext(0,1,f$ed(P1,"upcase")).eqs."H" then goto VACATION_HELP
$ wri ""
$ wri " VACATION.COM ''VAC_VERSION'"
$ wri ""
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."E" then goto VACATION_EDIT_DATA
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then goto BYPASS_VACATION_DAT
$ open/error=OPEN_ERROR VAC_FILE 'VAC$DIR''VAC_DATA'
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."P" then goto VACATION_PURGE_DATA
$VAC_LOOP:
$ gosub READ_LINE
$ if LINE_TYPE.eqs."" then goto VAC_FINISH_UP
$ if LINE_TYPE.EQS."*" then VAC_FLAG="YES"
$ if LINE_TYPE.eqs."*" then gosub DATE_CHECK
$ if LINE_TYPE.eqs."*" then gosub OUTPUT_COUNT
$ if LINE_TYPE.eqs."_" then gosub OUTPUT_REMINDER
$ goto VAC_LOOP
$VAC_FINISH_UP:
$ close VAC_FILE
$ exit
$BYPASS_VACATION_DAT:
$ if .not.NOHOURS then VAC_RD="*"+f$ext(0,20,f$ed(P2,"upcase,compress"))
$ if NOHOURS then VAC_RD="*"+f$ext(0,11,f$ed(P2,"upcase,compress"))
$ VAC_FLAG="YES"
$ gosub DATE_CHECK
$ if SWAP_FLAG.eq.1 then goto BYPASS_ERROR
$ VAC_MSG="'till date in question"
$ if .not.NOHOURS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHOURS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHOURS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if NOHOURS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ if NOHOURS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''VAC_MSG'''e_o'"
$ if NOHOURS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ exit
$BYPASS_ERROR:
$ wri " Date ""''p2'"" is prior to todays date, Please supply a Date"
$ wri " after Today'''s date, otherwise the countdown is meaningless"
$ exit
$!
$SETUP:
$ VAC_VERSION="V1.10"
$ VAC_FLAG="YES"
$ NOHOURS="NO"
$ NEWDATA="NO"
$ VAC$TEST=f$type(VAC$DIR)
$ if VAC$TEST.eqs."" then VAC$DIR="SYS$LOGIN:"
$ VAC$TEST=f$type(VAC$EDIT)
$ if VAC$TEST.eqs."" then VAC$EDIT="EDIT/TPU"
$ VAC_DATA="VACATION.DAT
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."F" then NEWDATA="YES"
$ if NEWDATA then VAC_DATA="''P2'"
$ if NEWDATA then P1=P3
$ if NEWDATA then P2=P4
$ if NEWDATA then P3=P5
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BR" then NOHOURS="YES"
$ if NOHOURS then P1=P2
$ if NOHOURS then P2=P3
$ esc[0,7]=27
$ e_o="''esc'[0m"
$ e_b="''esc'[1m"
$ e_u="''esc'[4m"
$ e_bl="''esc'[5m"
$ e_r="''esc'[7m"
$ e_c = "''esc'[2J"
$ e_t = "''esc'[24A"
$ VAC$OUT="''e_o'"
$ if P1.eqs."".or.f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then goto CONT_SETUP
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."N" then VAC$OUT="''e_o'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."A" then VAC$OUT="''e_b'''e_u'''e_bl'''e_r'"
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BO" then VAC$OUT="''e_b'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."U" then VAC$OUT="''e_u'"
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BL" then VAC$OUT="''e_bl'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."R" then VAC$OUT="''e_r'"
$CONT_SETUP:
$ c="comparison"
$ TODAYS_DATE=f$ti ()
$ if .not.NOHOURS then DATE_STAMP=f$ext(0,20,TODAYS_DATE)
$ if NOHOURS then DATE_STAMP=f$ext(0,11,TODAYS_DATE)
$ if .not.NOHOURS.and.f$ext(0,1,TODAYS_DATE).eqs." " then DATE_STAMP="0"+f$ext(1,19,TODAYS_DATE)
$ if NOHOURS.and.f$ext(0,1,TODAYS_DATE).eqs." " then DATE_STAMP="0"+f$ext(1,10,TODAYS_DATE)
$ DATE_REM=f$ext(0,11,DATE_STAMP)
$ DATE_ROUT=f$ext(0,11,DATE_STAMP)+" "
$ wri="write sys$output"
$ wrt="type sys$input"
$ wrf="write out_file"
$ return
$!
$!read line from VACATION.DAT or specified file for arrival date
$READ_LINE:
$ read/end_of_file=READ_EXIT VAC_FILE VAC_RD
$ LINE_TYPE=f$ext(0,1,VAC_RD)
$ return
$READ_EXIT:
$ LINE_TYPE = ""
$ return
$!
$DATE_CHECK:
$!Normalize sd to smaller than ld.
$ sd=f$cvt (DATE_STAMP, "absolute")
$ if .not.NOHOURS then ld=f$cvt (f$ext (1,20,VAC_RD), "absolute")
$ if NOHOURS then ld=f$cvt (f$ext (1,11,VAC_RD), "absolute")
$ swap_flag=0
$ if f$cvt (sd, "comparison").les.f$cvt (ld, "comparison") then goto NO_SWAP
$ swap_flag=1
$ t=sd
$ sd=ld
$ ld=t
$NO_SWAP:
$!Define internal variables.
$ ldc=f$cvt (ld, c)
$!Calculate answer to nearest day.
$ l=10000
$ form="!AS- 0:0:0.0"
$ gosub ZERO_IN
$R1:
$ days=t
$ if NOHOURS then return
$!Calculate answer to nearest hour.
$ l=24
$ form="0- !AS:0:0.0"
$ gosub ZERO_IN
$R2:
$ hrs=t
$!Calculate to nearest minute.
$ l=60
$ form="0- 0:!AS:0.0"
$ gosub ZERO_IN
$R3:
$ min=t
$!Calculate to nearest second.
$ l=60
$ form="0- 0:0:!AS.0"
$ gosub ZERO_IN
$R4:
$ sec=t
$ return
$!Calculate to nearest hundreths.this section is not used
$ l=100
$ form="0- 0:0:0.!AS"
$ gosub ZERO_IN
$R5:
$ hun=t
$! Subroutine to zero in, given ranges and a form.
$ZERO_IN:
$ s=-1
$ new_t=(s + l)/2
$TRY_VALUE:
$ t=new_t
$ if f$cvt (sd + "+''f$fao (form, f$string (t))'", c).les.ldc then -
goto TRY_LARGER_VALUE
$ new_t=(t + s)/2
$ if new_t.eq.t then goto VALUE_DONE
$ l=t
$ goto TRY_VALUE
$TRY_LARGER_VALUE:
$ new_t=(t + l)/2
$ if new_t.eq.t then goto VALUE_DONE
$ s=t
$ goto TRY_VALUE
$VALUE_DONE:
$ sd=f$cvt (sd + "+''f$fao (form, f$string (t))'", "absolute")
$ return
$!
$!output the Vacation countdown number
$OUTPUT_COUNT:
$ if .not.NOHOURS.and.SWAP_FLAG.eq.1 then return
$ if NOHOURS.and.SWAP_FLAG.eq.1.and.DAYS.gt.1 then VAC_FLAG="NO"
$ if NOHOURS.and.VAC_FLAG.eqs."NO" then return
$ if NOHOURS.and.SWAP_FLAG.eq.1.and.DAYS.eq.1 then DAYS=DAYS-1
$ days==days
$ VAC_MSG=f$ext(22,50,VAC_RD)
$ if .not.NOHOURS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHOURS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHOURS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if NOHOURS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ if NOHOURS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''VAC_MSG'''e_o'"
$ if NOHOURS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ return
$!
$!check for important reminder dates etc.
$OUTPUT_REMINDER:
$ if VAC_FLAG.eqs."NO" then return
$ VAC_DATE=f$ed(f$ext(1,11,VAC_RD),"UPCASE")
$ if f$ext(21,1,VAC_RD).eqs."@" then goto REMIND_ACTUAL
$ if f$ext(21,1,VAC_RD).eqs."+" then goto REMIND_AFTER
$ if f$ext(21,1,VAC_RD).eqs."-" then goto REMIND_BEFORE
$ return
$REMIND_ACTUAL:
$ if VAC_DATE.nes.DATE_REM then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$REMIND_AFTER:
$ gosub date_check
$ if DAYS.gt.7 then return
$ if SWAP_FLAG.eq.0 then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$REMIND_BEFORE:
$ gosub DATE_CHECK
$ if DAYS.gt.6 then return
$ if SWAP_FLAG.eq.1.and.days.gt.1 then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$VACATION_PURGE_DATA:
$ open/write VAC_FILE_TEMP 'VAC$DIR'VACATION.TMP
$ wri " Purging Old data from ''VAC$DIR'''VAC_DATA' - please wait"
$PURGE_LOOP:
$ gosub READ_LINE
$ if LINE_TYPE.eqs."" then goto PURGE_FINISH_UP
$ gosub DATE_CHECK
$ if SWAP_FLAG.EQS."1".and.DAYS.gt."7" then goto PURGE_LOOP
$ write VAC_FILE_TEMP "''VAC_RD'"
$ goto PURGE_LOOP
$PURGE_FINISH_UP:
$ close VAC_FILE
$ close VAC_FILE_TEMP
$ rename 'VAC$DIR'VACATION.TMP 'VAC$DIR''VAC_DATA'
$ purge/nolog 'VAC$DIR''VAC_DATA'
$ gosub VACATION_ENTRIES
$ exit
$VACATION_EDIT_DATA:
$ on ERROR then goto EDIT_ERROR
$ open VAC_FILE 'VAC$DIR''VAC_DATA'
$ close VAC_FILE
$EDIT_FILE:
$ assign /user_mode sys$command sys$input
$ VAC$EDIT 'VAC$DIR''VAC_DATA'
$ pur/nolog 'VAC$DIR''VAC_DATA'
$ rename 'VAC$DIR''VAC_DATA' 'VAC$DIR''VAC_DATA';1
$ wri ""
$ wri " VACATION.COM ''VAC_VERSION'"
$ wri ""
$ gosub VACATION_ENTRIES
$ exit
$EDIT_ERROR:
$ wri ""
$ wri " ''VAC$DIR'''VAC_DATA' does not exist, creating sample file"
$ open/write out_file 'VAC$DIR''VAC_DATA'
$ wrf "*''DATE_STAMP' Sample Countdown message (DELETE OR MODIFY THESE 4 LINES)"
$ wrf "_''DATE_ROUT'@Sample Reminder for this Date"
$ wrf "_''DATE_ROUT'-Sample Reminder for Today + 7 days prior"
$ wrf "_''DATE_ROUT'+Sample Reminder for Today + 7 days after"
$ close out_file
$ goto EDIT_FILE
$VACATION_ENTRIES:
$ open/read in_line 'VAC$DIR''VAC_DATA'
$ cnt=0
$ENTRY_LOOP:
$ read/end_of_file=ENTRY_END in_line test
$ if test.eqs."" then goto ENTRY_END
$ if f$ext(0,1,test).eqs."*" then cnt=cnt+1
$ goto ENTRY_LOOP
$ENTRY_END:
$ close in_line
$ if CNT.eq."0" then wri " ''VAC$DIR'''VAC_DATA' now contains ''esc'[1m''cnt'''esc'[0m Vacation entries"
$ if CNT.eq."1" then wri " ''VAC$DIR'''VAC_DATA' now contains entries for ''esc'[1m''cnt'''esc'[0m Vacation"
$ if CNT.gt."1" then wri " ''VAC$DIR'''VAC_DATA' now contains entries for ''esc'[1m''cnt'''esc'[0m different Vacations"
$ return
$OPEN_ERROR:
$ wri " ''VAC$DIR'''VAC_DATA' does not exist
$ wrt
You must perform a 'Edit' command option prior to running VACATION.COM for
The first time, or the symbol VAC$DIR contains the wrong information, Type
'Help' or '?' command option for help (ie. VACATION Help)
$ exit
$VACATION_HELP:
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VERSION' - Help Screen #1"
$ wrt
send comments to Claude SALEM::BERUBE_C
requires VMS V4.4 or above
This .COM uses a User supplied ASCII file called VACATION.DAT (see
VACATION.COM for details on VACATION.DAT). VACATION.COM will remind
you of the number of days, hours, minutes and seconds 'till a vacation
as well as remind you of important dates surrounding a vacation.
Define the following in your LOGIN.COM
$ VACATION:==@yourdisk:[youraccount]VACATION
If you wish to have your VACATION.DAT contained in another directory
other than SYS$LOGIN, define the following in LOGIN.COM
$ VAC$DIR == "yourdisk:[youraccount]"
If you wish to use your favorite editor, other than the default TPU,
then define the symbol VAC$EDIT in your LOGIN.COM, for example to use
SEDT as your editor define VAC$EDIT as follows
$ VAC$EDIT == "$SEDT$LIBRARY:SEDT"
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VERSION' - Help Screen #2"
$ wri ""
$ wri " Invoke VACATION.COM ''VAC_VERSION' by typing one of the following commands."
$ wrt
VACATION ? - - - - Prints this help message
VACATION Help- - - Prints this help message
VACATION - - - - - Run VACATION.COM with no special Screen output
VACATION Date nnnn Run VACATION.COM, bypassing the use of the
VACATION.DAT file, and uses nnnn as the date to
compare with todays date. NOTE nnnn must used either
dd-mmm-yyyy or "dd-mmm-yyyy hh:mm:ss" formats
VACATION Edit - - Edit VACATION.DAT file
VACATION Purge - - Purge VACATION.DAT of old data (7 days or older)
VACATION BRief xxx Your can also disable the HH:MM:SS from the output of
VACATION.COM with the TEST Command. Where xxx is
any of the valid commands accepted by VACATION.COM
(NOTE: the Date command will take precedence over the
BRief command). VACATION.COM will assume the
specified file resides in the directory pointed to by
the symbol VAC$DIR.
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VERSION' - Help Screen #3"
$ wri " "
$ wri " Invoke VACATION.COM ''VAC_VERSION' by typing one of the following Special Screen"
$ wri " output command."
$ wrt
VACATION All - - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_b'''e_r'''e_bl'''e_u'Bolded, Blinking, Underlined and Reverse Video''e_o'"
$ wrt
VACATION BLink - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_bl'Blinking''e_o'"
$ wrt
VACATION BOld - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_b'Bolded''e_o'"
$ wrt
VACATION None - - Run VACATION.COM with no special screen output
VACATION Reverse - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_r'Reverse Video''e_o'"
$ wrt
VACATION Under - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_u'Underlined''e_o'"
$ wri ""
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VERSION' - Help Screen #4"
$ wri " "
$ wrt
It is also posible to cause VACATION.COM to read a user supplied data
file other than it default VACATION.DAT. To do so invoke VACATION.COM
as follows
VACATION File FILENAME.EXT xxxx xxxx
where File tells VACATION.COM to use the specified file other
than VACATION.DAT
FILENAME.EXT is any legal VMS filename, VACATION.COM will look in
the directory specified by VAC$DIR
xxxx xxxx is any of the valid commands combinations accepted
by VACATION.COM (NOTE the Date command will take
precedence over the BRief command) VACATION.COM will
assume the specified file resides in the directory
pointed to by the symbol VAC$DIR.
$ exit
|
73.8 | new version | SALEM::BERUBE_C | Good Morning WDW!, in 143 days | Wed Dec 04 1991 11:45 | 579 |
| Well I did it again, I decided to add a couple of new features to
my VACATION.COM for personal reasons and decided to publish the results
here.
The 2 new features are
1. If you wish to change the number of days all reminders will be
displayed preceding/after the date specified on the reminder line,
then define the symbol VAC$REM in your LOGIN.COM. For example to
change the default from 7 days preceding/after the date specified to
14 days preceding/after, define VAC$REM as follows
$ VAC$REM == "14"
2. Added the Yearly command to ignore the Year field (ie dd-mm-yyyy) on
Reminder lines, this is useful for being reminded on yearly
occasions of upcoming events such as Holidays, Birthday etc. that
occur on the same day each year.
Item 2 above was the real reason for the new version, I decided to use
VACATION.COM to remind me of important dates that fall on the same day
each year like Holidays, Anniversaries, Birthdays etc. and just wanted
to be reminded of the upcoming event x days in advance and not be given
any countdown like a normal Vacation (rather simple modification vs the
countdown). What I did was create special data files for each month of
the year like SPECIAL_JAN_DATES.DAT to keep them seperate from my
normal VACATION.DAT file which I use to just track vacation info, and
did the follwoing in my Login.Com to execute it once a day when I first
log in.
$ if f$ext(0,11,f$time()).eqs.f$ext(0,11,f$file("sys$login:login.dat","cdt")) then goto no_resubmit
$FIRST_LOGIN:
$!place string of command you want for first time you log in here
$ vacation br ! got to keep track of my next vacation
$ vacation f special_'f$ext(3,3,f$TI())_dates.dat y !opps who's birthday etc.
$ delete sys$login:login.dat;
$ open/write file_out sys$login:login.dat
$ close file_out
$NO_RESUBMIT:
Have fun
Claude
_______CUT HERE________
$ goto START_PROGRAM !skip comments
VACATION.COM by Claude SALEM::BERUBE_C
with code borrowed from Eric Osman's date/time subtract
routine which was published in UKCSSE::COMMAND_PROCEDURES
notes file, note 58.15
This .COM file uses a User supplied ASCII file called VACATION.DAT (see below
for details on VACATION.DAT). VACATION.COM will remind you of the number of
days, hours, minutes and seconds 'till a vacation as well as remind you of
important dates surrounding a vacation.
Define the following in your LOGIN.COM
$ VACATION:==@yourdisk:[youraccount]VACATION
If you wish to have your VACATION.DAT contained in another directory other
than SYS$LOGIN, define the following in LOGIN.COM
$ VAC$DIR == "yourdisk:[youraccount]"
If you wish to use your favorite editor, other than the default TPU, then
define the symbol VAC$EDIT in your LOGIN.COM, for example to use SEDT as your
editor define VAC$EDIT as follows
$ VAC$EDIT == "$SEDT$LIBRARY:SEDT"
If you wish to change the number of days all reminders will be displayed
preceding/after the date specified on the reminder line, then define the
symbol VAC$REM in your LOGIN.COM. For example to change the default from 7
days preceding/after the date specified to 14 days preceding/after, define
VAC$REM as follows
$ VAC$REM == "14"
Then type
VACATION ?
for online help on the use of VACATION.COM and it's associated commands
VACATION.COM reads a user supplied ascii text file called VACATION ( or
the user may specify a different file other than the default VACATION.DAT, do
a VACATION ? for details) which contains lines in the following 2 formats.
*dd-mon-yyyy hh:mm:sscxxx... <- this is the countdown line format
_dd-mon-yyyy cxxx... <- this is the reminder line format
COUNTDOWN LINES,
the 1st character of a countdown line, must contain the character *, this
tells VACATION.COM to display the numbers of days, hours, minutes and seconds
left for a given upcoming vacation, based on characters #2 thru 21 which is
the upcoming date/time field that VACATION.COM will compare today's date to
and tell you the remainding days/hours/minutes/seconds left. Characters #2
thru 21 must be in the following format dd-mmm-yyyy hh:mm:ss (ie.
02-JUL-1989 12:30:00). Character #22 on the countdown field is unsused at
this time. Starting at character #23 on, the remainder of the countdown line
is the message to be display with the count (max of 50 characters in lenght,
this is so it'll display correctly on a 80 column display).
REMINDER LINES,
The 1st character of a Reminder line, must contain the character _, this
tells VACATION.COM, that the remainder of the line is to be used for
reminders based on the date field (character #2 thru 12 of the reminder line
NOTE characters 13-21 are unused at his time) and the reminder symbol
(character #22 of the reminder line). Characters #2 thru 12 is used for the
date you wish to be reminded of an activity, and must be in the dd-mmm-yyyy
format (ie. 02-JUL-1989). (NOTE characters 8-12 will be ignored if the
Yearly command is specified on the command line, and 13-21 are unused and
should be blanks) Charater #22 on a reminder line must be one of the
following symbols
@ = Print this reminder message only on this date only
+ = Print this reminder message on this date and the # of days
following this date specified by the symbol VAC$REM (default is
7). (this is good for reminder yourself on the earliest date in
wish to make a certain dinner reservation etc)
- = Print this reminder message on this date and the preceding # of
days specified by the symbol VAC$REM prior to this date (default
is 7). (this is good for reminding you of a due date for payment
etc)
Character #23 on, the remainder of the reminder line is reserved for the
reminder message (max of 50 characters in lenght)
NOTE it is recommended to use the 'Edit' command option when you invoke for
the first time, since VACATION.COM will create a Sample VACATION.DAT file for
you, that you can then Delete or Modify to your own requirements
------- SAMPLE VACATION.DAT I THINK YOU GET THE IDEA ----------
*30-NOV-1989 12:30:00 Sample Countdown message (DELETE OR MODIFY THESE 4 LINES)
_30-NOV-1989 @Sample Reminder for this Date
_30-NOV-1989 -Sample Reminder for Today and 7 days prior
_30-NOV-1989 +Sample Reminder for Today and 7 days after
Revision history:
6-APR-89 V1.0 Initial DISNEY.COM Release, actually coded in '86 but forget
the date
6-APR-89 V1.1 Added Eric Osmon's code to make Disney.Com run faster, and
have Disney.Dat contain less data
7-APR-89 V1.2 Added BOld/BLink etc. commands, added feature to prompt upto
7 days prior/after reminder date, renamed files to
VACATION.COM and VACATION.DAT
10-APR-89 V1.3 Fixes bug with DATE_STAMP
17-APR-89 V1.4 Fixed a few logic bugs, eliminate the printing of old data
27-NOV-89 V1.5 Added the Purge command to purge old data in VACATION.DAT,
also added the ? and H command for help message, and
intructions on use at end of file
30-NOV-89 V1.6 Fixed logic for determining command parser, allow for minimum
number of characters to be typed, added command Edit to allow
users to edit VACATION.DAT from within VACATION.COM, added
symbol VAC$EDIT to specify editor to use, also create a
sample VACATION.DAT file when not found, when doing a
VACATION Edit command
08-MAR-90 V1.7 Added logic to display the remaining hours/minutes/seconds in
addition to days. This feature is not used on reminder lines
at this time.
07-FEB-91 V1.8 Added Date command, to accept P2 as the countdown date to
compare today's date to, thereby bypassing the need for a
VACATION.DAT file, useful when first planning a vacation,
must be in the format of dd-mmm-yyy or "dd-mmm-yyy hh:mm:ss".
Also edited help message to point to my new node.
01-JUN-91 V1.9 Added File command, to force VACATION.COM to use another file
other than VACATION.DAT, assumes file is located in the
directory pointed to by the VAC$DIR symbol (default is
SYS$LOGIN). Added the assigning of symbol DAYS for use by
other procedures, this symbol will contain the number of Days
left prior to the LAST vacation listed in VACATION.DAT or
file specified at the completion of VACATION.COM execution.
07-JUL-91 V1.10 Added the BRief Command, this will cause VACATION.COM to not
display the HH:MM:SS left.
04-DEC-91 V1.11 Added the Yearly command to ignore the Year field (ie
dd-mm-yyyy) on Reminder lines, this is useful for being
reminded on yearly ocasions of upcoming events such as
Holidays, Birthday etc. that occur on the same day each
year. Also added the Symbol VAC$REM for allowing the user to
change the default of 7 days for the notification of
reminders.
$START_PROGRAM:
$ gosub SETUP
$ if f$ed(P1,"upcase").eqs."?".or.f$ext(0,1,f$ed(P1,"upcase")).eqs."H" then goto VAC_HLP
$ wri ""
$ wri " VACATION.COM ''VAC_VRS'"
$ wri ""
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."E" then goto VAC_ED_DAT
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then goto BYP_VAC_DAT
$ open/error=OPEN_ERR VAC_FILE 'VAC$DIR''VAC_DATA'
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."P" then goto VAC_PUR_DAT
$VAC_LP:
$ gosub RD_LINE
$ if LINE_TYP.eqs."" then goto VAC_FIN_UP
$ if LINE_TYP.EQS."*" then VAC_FLG="YES"
$ if LINE_TYP.eqs."*" then gosub DATE_CHK
$ if LINE_TYP.eqs."*" then gosub OUT_CNT
$ if LINE_TYP.eqs."_" then gosub OUT_REM
$ goto VAC_LP
$VAC_FIN_UP:
$ close VAC_FILE
$ exit
$BYP_VAC_DAT:
$ if .not.NOHRS then VAC_RD="*"+f$ext(0,20,f$ed(P2,"upcase,compress"))
$ if NOHRS then VAC_RD="*"+f$ext(0,11,f$ed(P2,"upcase,compress"))
$ VAC_FLG="YES"
$ gosub DATE_CHK
$ if SWP_FLG.eq.1 then goto BYP_ERR
$ VAC_MSG="'till date in question"
$ if .not.NOHRS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHRS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHRS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ exit
$BYP_ERR:
$ wri " Date ""''p2'"" is prior to todays date, Please supply a Date"
$ wri " after Today'''s date, otherwise the countdown is meaningless"
$ exit
$!
$SETUP:
$ VAC_VRS="V1.11"
$ VAC_FLG="YES"
$ NOHRS="NO"
$ NOYR="NO"
$ NDATA="NO"
$ VAC$TEST=f$type(VAC$DIR)
$ if VAC$TEST.eqs."" then VAC$DIR="SYS$LOGIN:"
$ VAC$TEST=f$type(VAC$EDIT)
$ if VAC$TEST.eqs."" then VAC$EDIT="EDIT/TPU"
$ VAC$TEST=f$type(VAC$REM)
$ if VAC$TEST.eqs."" then VAC$REM=7
$ VAC_DATA="VACATION.DAT"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."F" then NDATA="YES"
$ if NDATA then VAC_DATA="''P2'"
$ if NDATA then P1=P3
$ if NDATA then P2=P4
$ if NDATA then P3=P5
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BR" then NOHRS="YES"
$ if NOHRS then P1=P2
$ if NOHRS then P2=P3
$ esc[0,7]=27
$ e_o="''esc'[0m"
$ e_b="''esc'[1m"
$ e_u="''esc'[4m"
$ e_bl="''esc'[5m"
$ e_r="''esc'[7m"
$ e_c = "''esc'[2J"
$ e_t = "''esc'[24A"
$ VAC$OUT="''e_o'"
$ if P1.eqs."".or.f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then goto CONT_SETUP
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."N" then VAC$OUT="''e_o'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."A" then VAC$OUT="''e_b'''e_u'''e_bl'''e_r'"
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BO" then VAC$OUT="''e_b'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."U" then VAC$OUT="''e_u'"
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BL" then VAC$OUT="''e_bl'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."R" then VAC$OUT="''e_r'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."Y" then NOYR="YES"
$CONT_SETUP:
$ c="comparison"
$ TODAYS_DATE=f$ti ()
$ if .not.NOHRS then DATE_STP=f$ext(0,20,TODAYS_DATE)
$ if NOHRS then DATE_STP=f$ext(0,11,TODAYS_DATE)
$ if .not.NOHRS.and.f$ext(0,1,TODAYS_DATE).eqs." " then DATE_STP="0"+f$ext(1,19,TODAYS_DATE)
$ if NOHRS.and.f$ext(0,1,TODAYS_DATE).eqs." " then DATE_STP="0"+f$ext(1,10,TODAYS_DATE)
$ if .not.NOYR then DATE_REM=f$ext(0,11,DATE_STP)
$ if NOYR then DATE_REM=f$ext(0,6,DATE_STP)
$ DATE_ROUT=f$ext(0,11,DATE_STP)+" "
$ wri="write sys$output"
$ wrt="type sys$input"
$ wrf="write out_file"
$ return
$!
$!read line from VACATION.DAT or specified file for arrival date
$RD_LINE:
$ read/end_of_file=RD_EXIT VAC_FILE VAC_RD
$ LINE_TYP=f$ext(0,1,VAC_RD)
$ return
$RD_EXIT:
$ LINE_TYP = ""
$ return
$!
$DATE_CHK:
$!Normalize sd to smaller than ld.
$ sd=f$cvt (DATE_STP, "absolute")
$ if .not.NOHRS.and..not.NOYR then ld=f$cvt (f$ext (1,20,VAC_RD), "absolute")
$ if NOHRS then ld=f$cvt (f$ext (1,11,VAC_RD), "absolute")
$ if NOYR then ld=f$cvt (f$ext (1,6,VAC_RD), "absolute")
$ SWP_FLG=0
$ if f$cvt (sd, "comparison").les.f$cvt (ld, "comparison") then goto NO_SWP
$ SWP_FLG=1
$ t=sd
$ sd=ld
$ ld=t
$NO_SWP:
$!Define internal variables.
$ ldc=f$cvt (ld, c)
$!Calculate answer to nearest day.
$ l=10000
$ form="!AS- 0:0:0.0"
$ gosub ZERO_IN
$R1:
$ days=t
$ if NOHRS then return
$!Calculate answer to nearest hour.
$ l=24
$ form="0- !AS:0:0.0"
$ gosub ZERO_IN
$R2:
$ hrs=t
$!Calculate to nearest minute.
$ l=60
$ form="0- 0:!AS:0.0"
$ gosub ZERO_IN
$R3:
$ min=t
$!Calculate to nearest second.
$ l=60
$ form="0- 0:0:!AS.0"
$ gosub ZERO_IN
$R4:
$ sec=t
$ return
$!Calculate to nearest hundreths.this section is not used
$ l=100
$ form="0- 0:0:0.!AS"
$ gosub ZERO_IN
$R5:
$ hun=t
$! Subroutine to zero in, given ranges and a form.
$ZERO_IN:
$ s=-1
$ new_t=(s + l)/2
$TRY_VAL:
$ t=new_t
$ if f$cvt (sd + "+''f$fao (form, f$string (t))'", c).les.ldc then -
goto TRY_LRG_VAL
$ new_t=(t + s)/2
$ if new_t.eq.t then goto VAl_DONE
$ l=t
$ goto TRY_VAL
$TRY_LRG_VAL:
$ new_t=(t + l)/2
$ if new_t.eq.t then goto VAl_DONE
$ s=t
$ goto TRY_VAL
$VAl_DONE:
$ sd=f$cvt (sd + "+''f$fao (form, f$string (t))'", "absolute")
$ return
$!
$!output the Vacation countdown number
$OUT_CNT:
$ if .not.NOHRS.and.SWP_FLG.eq.1 then return
$ if NOHRS.and.SWP_FLG.eq.1.and.DAYS.gt.1 then VAC_FLG="NO"
$ if NOHRS.and.VAC_FLG.eqs."NO" then return
$ if NOHRS.and.SWP_FLG.eq.1.and.DAYS.eq.1 then DAYS=DAYS-1
$ days==days
$ VAC_MSG=f$ext(22,50,VAC_RD)
$ if .not.NOHRS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHRS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHRS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ return
$!
$!check for important reminder dates etc.
$OUT_REM:
$ if VAC_FLG.eqs."NO" then return
$ if .not.NOYR then VAC_DATE=f$ed(f$ext(1,11,VAC_RD),"UPCASE")
$ if NOYR then VAC_DATE=f$ed(f$ext(1,6,VAC_RD),"UPCASE")
$ if f$ext(21,1,VAC_RD).eqs."@" then goto RMD_ACTUAL
$ if f$ext(21,1,VAC_RD).eqs."+" then goto RMD_AFTER
$ if f$ext(21,1,VAC_RD).eqs."-" then goto RMD_BEFORE
$ return
$RMD_ACTUAL:
$ if VAC_DATE.nes.DATE_REM then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$RMD_AFTER:
$ gosub DATE_CHK
$ if DAYS.gt.VAC$REM then return
$ if SWP_FLG.eq.0 then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$RMD_BEFORE:
$ gosub DATE_CHK
$ VAC$REM1=VAC$REM-1
$ if DAYS.gt.VAC$REM1 then return
$ if SWP_FLG.eq.1.and.days.ge.1 then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$VAC_PUR_DAT:
$ open/write VAC_FILE_TMP 'VAC$DIR'VACATION.TMP
$ wri " Purging Old data from ''VAC$DIR'''VAC_DATA' - please wait"
$PUR_LP:
$ gosub RD_LINE
$ if LINE_TYP.eqs."" then goto PUR_FIN_UP
$ gosub DATE_CHK
$ if SWP_FLG.EQS."1".and.DAYS.gt.VAC$REM then goto PUR_LP
$ write VAC_FILE_TMP "''VAC_RD'"
$ goto PUR_LP
$PUR_FIN_UP:
$ close VAC_FILE
$ close VAC_FILE_TMP
$ rename 'VAC$DIR'VACATION.TMP 'VAC$DIR''VAC_DATA'
$ purge/nolog 'VAC$DIR''VAC_DATA'
$ gosub VAC_ENTS
$ exit
$VAC_ED_DAT:
$ on ERROR then goto EDT_ERR
$ open VAC_FILE 'VAC$DIR''VAC_DATA'
$ close VAC_FILE
$EDT_FILE:
$ assign /user_mode sys$command sys$input
$ VAC$EDIT 'VAC$DIR''VAC_DATA'
$ pur/nolog 'VAC$DIR''VAC_DATA'
$ rename 'VAC$DIR''VAC_DATA' 'VAC$DIR''VAC_DATA';1
$ wri ""
$ wri " VACATION.COM ''VAC_VRS'"
$ wri ""
$ gosub VAC_ENTS
$ exit
$EDT_ERR:
$ wri ""
$ wri " ''VAC$DIR'''VAC_DATA' does not exist, creating sample file"
$ open/write out_file 'VAC$DIR''VAC_DATA'
$ wrf "*''DATE_STP' Sample Countdown message (DELETE OR MODIFY THESE 4 LINES)"
$ wrf "_''DATE_ROUT'@Sample Reminder for this Date"
$ wrf "_''DATE_ROUT'-Sample Reminder for Today + 7 days prior"
$ wrf "_''DATE_ROUT'+Sample Reminder for Today + 7 days after"
$ close out_file
$ goto EDT_FILE
$VAC_ENTS:
$ open/read in_line 'VAC$DIR''VAC_DATA'
$ cnt=0
$ENT_LP:
$ read/end_of_file=ENT_END in_line test
$ if test.eqs."" then goto ENT_END
$ if f$ext(0,1,test).eqs."*" then cnt=cnt+1
$ goto ENT_LP
$ENT_END:
$ close in_line
$ if CNT.eq."0" then wri " ''VAC$DIR'''VAC_DATA' now contains ''esc'[1m''cnt'''esc'[0m Vacation entries"
$ if CNT.eq."1" then wri " ''VAC$DIR'''VAC_DATA' now contains entries for ''esc'[1m''cnt'''esc'[0m Vacation"
$ if CNT.gt."1" then wri " ''VAC$DIR'''VAC_DATA' now contains entries for ''esc'[1m''cnt'''esc'[0m different Vacations"
$ return
$OPEN_ERR:
$ wri " ''VAC$DIR'''VAC_DATA' does not exist
$ wrt
You must perform a 'Edit' command option prior to running VACATION.COM for
The first time, or the symbol VAC$DIR contains the wrong information, Type
'Help' or '?' command option for help (ie. VACATION Help)
$ exit
$VAC_HLP:
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #1"
$ wrt
send comments to Claude SALEM::BERUBE_C
requires VMS V4.4 or above
This .COM uses a User supplied ASCII file called VACATION.DAT (see
VACATION.COM for details on VACATION.DAT). VACATION.COM will remind
you of the number of days, hours, minutes and seconds 'till a vacation
as well as remind you of important dates surrounding a vacation.
In order to invoke VACATION.COM Define the following in your LOGIN.COM
$ VACATION:==@yourdisk:[youraccount]VACATION
VACATION.COM also uses the following symbols, which may be defined by
the user when running, they are as follows;
If you wish to have your VACATION.DAT contained in another directory
other than the default SYS$LOGIN, define the following in LOGIN.COM
$ VAC$DIR == "yourdisk:[youraccount]"
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #2"
$ wrt
If you wish to use your favorite editor, other than the default TPU,
then define the symbol VAC$EDIT in your LOGIN.COM. For example to use
SEDT as your editor define VAC$EDIT as follows
$ VAC$EDIT == "$SEDT$LIBRARY:SEDT"
If you wish to change the number of days all reminders will be
displayed preceding/after the date specified on the reminder line,
then define the symbol VAC$REM in your LOGIN.COM. For example to
change the default from 7 days preceding/after the date specified to 14
days preceding/after, define VAC$REM as follows
$ VAC$REM == "14"
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #3"
$ wri ""
$ wri " Invoke VACATION.COM ''VAC_VRS' by typing one of the following commands."
$ wrt
VACATION ? - - - - Prints this help message
VACATION Help- - - Prints this help message
VACATION - - - - - Run VACATION.COM with no special Screen output
VACATION Date nnnn Run VACATION.COM, bypassing the use of the VACATION.DAT
file, and uses nnnn as the date to compare with todays
date. NOTE nnnn must used either dd-mmm-yyyy or
"dd-mmm-yyyy hh:mm:ss" formats
VACATION Edit - - Edit VACATION.DAT file
VACATION Purge - - Purge VACATION.DAT of old data, based on VAC$REM value
VACATION BRief xxx Your can also disable the HH:MM:SS from the output of
VACATION.COM with the BRief Command. Where xxx is any
of the valid commands accepted by VACATION.COM (NOTE:
the Date command will take precedence over the BRief
command). VACATION.COM will assume the specified file
resides in the directory pointed to by the symbol
VAC$DIR.
VACATION Yearly - Ignore the Date field on reminder lines(ie dd-mmm-yyyy)
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #4"
$ wri " "
$ wri " Invoke VACATION.COM ''VAC_VRS' by typing one of the following Special Screen"
$ wri " output command."
$ wrt
VACATION All - - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_b'''e_r'''e_bl'''e_u'Bolded, Blinking, Underlined and Reverse Video''e_o'"
$ wrt
VACATION BLink - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_bl'Blinking''e_o'"
$ wrt
VACATION BOld - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_b'Bolded''e_o'"
$ wrt
VACATION None - - Run VACATION.COM with no special screen output
VACATION Reverse - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_r'Reverse Video''e_o'"
$ wrt
VACATION Under - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_u'Underlined''e_o'"
$ wri ""
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #5"
$ wri " "
$ wrt
It is also posible to cause VACATION.COM to read a user supplied data
file other than it default VACATION.DAT. To do so invoke VACATION.COM
as follows
VACATION File FILENAME.EXT xxxx xxxx
where File tells VACATION.COM to use the specified file other
than VACATION.DAT
FILENAME.EXT is any legal VMS filename, VACATION.COM will look in
the directory specified by VAC$DIR
xxxx xxxx is any of the valid commands combinations accepted
by VACATION.COM (NOTE the Date command will take
precedence over the BRief command) VACATION.COM will
assume the specified file resides in the directory
pointed to by the symbol VAC$DIR.
$ exit
|
73.9 | bug fix - new version | SALEM::BERUBE_C | Good Morning WDW!, in 2 days | Thu Apr 23 1992 08:19 | 569 |
| Well people must be getting ready for vacation, I have been inundated
with help requests in the past week for help in getting VACATION.COM to
work. All had the same symtom, they would define the proper symbols,
do a
VACATION
and would get the
VACATION V1.11
version message and nothing else. Well I decided to look into this
further and found out that if you have a blank line in your
VACATION.DAT file you'd get bounced outa the parsing of the file,
especialy if the first line is blank you get the above senario.
So the version below corrects this and now allows for blank lines in
your VACATION.DAT file (2 simple lines of code).
Note also that it is ok to have move than one Countdown line (vacation
date) in your VACATION.DAT file providing all REMINDER lines follow
their corresponding COUNTDOWN lines
Have fun, don't bother me today, I need to work, then I'm off to pack
and go you know where
--------CUT HERE-------
$ goto START_PROGRAM !skip comments
VACATION.COM by Claude SALEM::BERUBE_C
with code borrowed from Eric Osman's date/time subtract
routine which was published in UKCSSE::COMMAND_PROCEDURES
notes file, note 58.15
This .COM file uses a User supplied ASCII file called VACATION.DAT (see below
for details on VACATION.DAT). VACATION.COM will remind you of the number of
days, hours, minutes and seconds 'till a vacation as well as remind you of
important dates surrounding a vacation.
Define the following in your LOGIN.COM
$ VACATION:==@yourdisk:[youraccount]VACATION
If you wish to have your VACATION.DAT contained in another directory other
than SYS$LOGIN, define the following in LOGIN.COM
$ VAC$DIR == "yourdisk:[youraccount]"
If you wish to use your favorite editor, other than the default TPU, then
define the symbol VAC$EDIT in your LOGIN.COM, for example to use SEDT as your
editor define VAC$EDIT as follows
$ VAC$EDIT == "$SEDT$LIBRARY:SEDT"
If you wish to change the number of days all reminders will be displayed
preceding/after the date specified on the reminder line, then define the
symbol VAC$REM in your LOGIN.COM. For example to change the default from 7
days preceding/after the date specified to 14 days preceding/after, define
VAC$REM as follows
$ VAC$REM == "14"
Then type
VACATION ?
for online help on the use of VACATION.COM and it's associated commands
VACATION.COM reads a user supplied ascii text file called VACATION ( or
the user may specify a different file other than the default VACATION.DAT, do
a VACATION ? for details) which contains lines in the following 2 formats.
*dd-mon-yyyy hh:mm:sscxxx... <- this is the countdown line format
_dd-mon-yyyy cxxx... <- this is the reminder line format
COUNTDOWN LINES,
the 1st character of a countdown line, must contain the character *, this
tells VACATION.COM to display the numbers of days, hours, minutes and seconds
left for a given upcoming vacation, based on characters #2 thru 21 which is
the upcoming date/time field that VACATION.COM will compare today's date to
and tell you the remainding days/hours/minutes/seconds left. Characters #2
thru 21 must be in the following format dd-mmm-yyyy hh:mm:ss (ie.
02-JUL-1989 12:30:00). Character #22 on the countdown field is unsused at
this time. Starting at character #23 on, the remainder of the countdown line
is the message to be display with the count (max of 50 characters in lenght,
this is so it'll display correctly on a 80 column display).
REMINDER LINES,
The 1st character of a Reminder line, must contain the character _, this
tells VACATION.COM, that the remainder of the line is to be used for
reminders based on the date field (character #2 thru 12 of the reminder line
NOTE characters 13-21 are unused at his time) and the reminder symbol
(character #22 of the reminder line). Characters #2 thru 12 is used for the
date you wish to be reminded of an activity, and must be in the dd-mmm-yyyy
format (ie. 02-JUL-1989). (NOTE characters 8-12 will be ignored if the
Yearly command is specified on the command line, and 13-21 are unused and
should be blanks) Charater #22 on a reminder line must be one of the
following symbols
@ = Print this reminder message only on this date only
+ = Print this reminder message on this date and the # of days
following this date specified by the symbol VAC$REM (default is
7). (this is good for reminder yourself on the earliest date in
wish to make a certain dinner reservation etc)
- = Print this reminder message on this date and the preceding # of
days specified by the symbol VAC$REM prior to this date (default
is 7). (this is good for reminding you of a due date for payment
etc)
Character #23 on, the remainder of the reminder line is reserved for the
reminder message (max of 50 characters in lenght)
NOTE that it is ok to have move than one COUNTDOWN line (vacation date) in
your VACATION.DAT file providing all REMINDER lines follow their
corresponding COUNTDOWN lines
NOTE ALSO that it is recommended to you use the 'Edit' command option when
you invoke for the first time, since VACATION.COM will create a Sample
VACATION.DAT file for you, that you can then Delete or Modify to your own
requirements
------- SAMPLE VACATION.DAT I THINK YOU GET THE IDEA ----------
*30-NOV-1989 12:30:00 Sample Countdown message (DELETE OR MODIFY THESE 4 LINES)
_30-NOV-1989 @Sample Reminder for this Date
_30-NOV-1989 -Sample Reminder for Today and 7 days prior
_30-NOV-1989 +Sample Reminder for Today and 7 days after
Revision history:
6-APR-89 V1.0 Initial DISNEY.COM Release, actually coded in '86 but forget
the date
6-APR-89 V1.1 Added Eric Osmon's code to make Disney.Com run faster, and
have Disney.Dat contain less data
7-APR-89 V1.2 Added BOld/BLink etc. commands, added feature to prompt upto
7 days prior/after reminder date, renamed files to
VACATION.COM and VACATION.DAT
10-APR-89 V1.3 Fixes bug with DATE_STAMP
17-APR-89 V1.4 Fixed a few logic bugs, eliminate the printing of old data
27-NOV-89 V1.5 Added the Purge command to purge old data in VACATION.DAT,
also added the ? and H command for help message, and
intructions on use at end of file
30-NOV-89 V1.6 Fixed logic for determining command parser, allow for minimum
number of characters to be typed, added command Edit to allow
users to edit VACATION.DAT from within VACATION.COM, added
symbol VAC$EDIT to specify editor to use, also create a
sample VACATION.DAT file when not found, when doing a
VACATION Edit command
08-MAR-90 V1.7 Added logic to display the remaining hours/minutes/seconds in
addition to days. This feature is not used on reminder lines
at this time.
07-FEB-91 V1.8 Added Date command, to accept P2 as the countdown date to
compare today's date to, thereby bypassing the need for a
VACATION.DAT file, useful when first planning a vacation,
must be in the format of dd-mmm-yyy or "dd-mmm-yyy hh:mm:ss".
Also edited help message to point to my new node.
01-JUN-91 V1.9 Added File command, to force VACATION.COM to use another file
other than VACATION.DAT, assumes file is located in the
directory pointed to by the VAC$DIR symbol (default is
SYS$LOGIN). Added the assigning of symbol DAYS for use by
other procedures, this symbol will contain the number of Days
left prior to the LAST vacation listed in VACATION.DAT or
file specified at the completion of VACATION.COM execution.
07-JUL-91 V1.10 Added the BRief Command, this will cause VACATION.COM to not
display the HH:MM:SS left.
04-DEC-91 V1.11 Added the Yearly command to ignore the Year field (ie
dd-mm-yyyy) on Reminder lines, this is useful for being
reminded on yearly ocasions of upcoming events such as
Holidays, Birthday etc. that occur on the same day each
year. Also added the Symbol VAC$REM for allowing the user to
change the default of 7 days for the notification of
reminders.
23-APR-92 V1.12 Fix code for parsing VACATION.DAT to allow for blank lines.
$START_PROGRAM:
$ gosub SETUP
$ if f$ed(P1,"upcase").eqs."?".or.f$ext(0,1,f$ed(P1,"upcase")).eqs."H" then goto VAC_HLP
$ wri ""
$ wri " VACATION.COM ''VAC_VRS'"
$ wri ""
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."E" then goto VAC_ED_DAT
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then goto BYP_VAC_DAT
$ open/error=OPEN_ERR VAC_FILE 'VAC$DIR''VAC_DATA'
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."P" then goto VAC_PUR_DAT
$VAC_LP:
$ gosub RD_LINE
$ if LINE_TYP.eqs."" then goto VAC_FIN_UP
$ if LINE_TYP.eqs."BLANK" then goto VAC_LP
$ if LINE_TYP.EQS."*" then VAC_FLG="YES"
$ if LINE_TYP.eqs."*" then gosub DATE_CHK
$ if LINE_TYP.eqs."*" then gosub OUT_CNT
$ if LINE_TYP.eqs."_" then gosub OUT_REM
$ goto VAC_LP
$VAC_FIN_UP:
$ close VAC_FILE
$ exit
$BYP_VAC_DAT:
$ if .not.NOHRS then VAC_RD="*"+f$ext(0,20,f$ed(P2,"upcase,compress"))
$ if NOHRS then VAC_RD="*"+f$ext(0,11,f$ed(P2,"upcase,compress"))
$ VAC_FLG="YES"
$ gosub DATE_CHK
$ if SWP_FLG.eq.1 then goto BYP_ERR
$ VAC_MSG="'till date in question"
$ if .not.NOHRS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHRS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHRS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ exit
$BYP_ERR:
$ wri " Date ""''p2'"" is prior to todays date, Please supply a Date"
$ wri " after Today'''s date, otherwise the countdown is meaningless"
$ exit
$!
$SETUP:
$ VAC_VRS="V1.12"
$ VAC_FLG="YES"
$ NOHRS="NO"
$ NOYR="NO"
$ NDATA="NO"
$ VAC$TEST=f$type(VAC$DIR)
$ if VAC$TEST.eqs."" then VAC$DIR="SYS$LOGIN:"
$ VAC$TEST=f$type(VAC$EDIT)
$ if VAC$TEST.eqs."" then VAC$EDIT="EDIT/TPU"
$ VAC$TEST=f$type(VAC$REM)
$ if VAC$TEST.eqs."" then VAC$REM=7
$ VAC_DATA="VACATION.DAT"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."F" then NDATA="YES"
$ if NDATA then VAC_DATA="''P2'"
$ if NDATA then P1=P3
$ if NDATA then P2=P4
$ if NDATA then P3=P5
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BR" then NOHRS="YES"
$ if NOHRS then P1=P2
$ if NOHRS then P2=P3
$ esc[0,7]=27
$ e_o="''esc'[0m"
$ e_b="''esc'[1m"
$ e_u="''esc'[4m"
$ e_bl="''esc'[5m"
$ e_r="''esc'[7m"
$ e_c = "''esc'[2J"
$ e_t = "''esc'[24A"
$ VAC$OUT="''e_o'"
$ if P1.eqs."".or.f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then goto CONT_SETUP
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."N" then VAC$OUT="''e_o'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."A" then VAC$OUT="''e_b'''e_u'''e_bl'''e_r'"
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BO" then VAC$OUT="''e_b'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."U" then VAC$OUT="''e_u'"
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BL" then VAC$OUT="''e_bl'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."R" then VAC$OUT="''e_r'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."Y" then NOYR="YES"
$CONT_SETUP:
$ c="comparison"
$ TODAYS_DATE=f$ti ()
$ if .not.NOHRS then DATE_STP=f$ext(0,20,TODAYS_DATE)
$ if NOHRS then DATE_STP=f$ext(0,11,TODAYS_DATE)
$ if .not.NOHRS.and.f$ext(0,1,TODAYS_DATE).eqs." " then DATE_STP="0"+f$ext(1,19,TODAYS_DATE)
$ if NOHRS.and.f$ext(0,1,TODAYS_DATE).eqs." " then DATE_STP="0"+f$ext(1,10,TODAYS_DATE)
$ if .not.NOYR then DATE_REM=f$ext(0,11,DATE_STP)
$ if NOYR then DATE_REM=f$ext(0,6,DATE_STP)
$ DATE_ROUT=f$ext(0,11,DATE_STP)+" "
$ wri="write sys$output"
$ wrt="type sys$input"
$ wrf="write out_file"
$ return
$!
$!read line from VACATION.DAT or specified file for arrival date
$RD_LINE:
$ read/end_of_file=RD_EXIT VAC_FILE VAC_RD
$ LINE_TYP=f$ext(0,1,VAC_RD)
$ if LINE_TYP.eqs."" then LINE_TYP="BLANK"
$ return
$RD_EXIT:
$ LINE_TYP = ""
$ return
$!
$DATE_CHK:
$!Normalize sd to smaller than ld.
$ sd=f$cvt (DATE_STP, "absolute")
$ if .not.NOHRS.and..not.NOYR then ld=f$cvt (f$ext (1,20,VAC_RD), "absolute")
$ if NOHRS then ld=f$cvt (f$ext (1,11,VAC_RD), "absolute")
$ if NOYR then ld=f$cvt (f$ext (1,6,VAC_RD), "absolute")
$ SWP_FLG=0
$ if f$cvt (sd, "comparison").les.f$cvt (ld, "comparison") then goto NO_SWP
$ SWP_FLG=1
$ t=sd
$ sd=ld
$ ld=t
$NO_SWP:
$!Define internal variables.
$ ldc=f$cvt (ld, c)
$!Calculate answer to nearest day.
$ l=10000
$ form="!AS- 0:0:0.0"
$ gosub ZERO_IN
$R1:
$ days=t
$ if NOHRS then return
$!Calculate answer to nearest hour.
$ l=24
$ form="0- !AS:0:0.0"
$ gosub ZERO_IN
$R2:
$ hrs=t
$!Calculate to nearest minute.
$ l=60
$ form="0- 0:!AS:0.0"
$ gosub ZERO_IN
$R3:
$ min=t
$!Calculate to nearest second.
$ l=60
$ form="0- 0:0:!AS.0"
$ gosub ZERO_IN
$R4:
$ sec=t
$ return
$!Calculate to nearest hundreths.this section is not used
$ l=100
$ form="0- 0:0:0.!AS"
$ gosub ZERO_IN
$R5:
$ hun=t
$! Subroutine to zero in, given ranges and a form.
$ZERO_IN:
$ s=-1
$ new_t=(s + l)/2
$TRY_VAL:
$ t=new_t
$ if f$cvt (sd + "+''f$fao (form, f$string (t))'", c).les.ldc then -
goto TRY_LRG_VAL
$ new_t=(t + s)/2
$ if new_t.eq.t then goto VAl_DONE
$ l=t
$ goto TRY_VAL
$TRY_LRG_VAL:
$ new_t=(t + l)/2
$ if new_t.eq.t then goto VAl_DONE
$ s=t
$ goto TRY_VAL
$VAl_DONE:
$ sd=f$cvt (sd + "+''f$fao (form, f$string (t))'", "absolute")
$ return
$!
$!output the Vacation countdown number
$OUT_CNT:
$ if .not.NOHRS.and.SWP_FLG.eq.1 then return
$ if NOHRS.and.SWP_FLG.eq.1.and.DAYS.gt.1 then VAC_FLG="NO"
$ if NOHRS.and.VAC_FLG.eqs."NO" then return
$ if NOHRS.and.SWP_FLG.eq.1.and.DAYS.eq.1 then DAYS=DAYS-1
$ days==days
$ VAC_MSG=f$ext(22,50,VAC_RD)
$ if .not.NOHRS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHRS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if .not.NOHRS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.gt.1 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.eq.1 then wri "''VAC$OUT' ''days' day, ''VAC_MSG'''e_o'"
$ if NOHRS.and.DAYS.eq.0 then wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ return
$!
$!check for important reminder dates etc.
$OUT_REM:
$ if VAC_FLG.eqs."NO" then return
$ if .not.NOYR then VAC_DATE=f$ed(f$ext(1,11,VAC_RD),"UPCASE")
$ if NOYR then VAC_DATE=f$ed(f$ext(1,6,VAC_RD),"UPCASE")
$ if f$ext(21,1,VAC_RD).eqs."@" then goto RMD_ACTUAL
$ if f$ext(21,1,VAC_RD).eqs."+" then goto RMD_AFTER
$ if f$ext(21,1,VAC_RD).eqs."-" then goto RMD_BEFORE
$ return
$RMD_ACTUAL:
$ if VAC_DATE.nes.DATE_REM then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$RMD_AFTER:
$ gosub DATE_CHK
$ if DAYS.gt.VAC$REM then return
$ if SWP_FLG.eq.0 then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$RMD_BEFORE:
$ gosub DATE_CHK
$ VAC$REM1=VAC$REM-1
$ if DAYS.gt.VAC$REM1 then return
$ if SWP_FLG.eq.1.and.days.ge.1 then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ return
$VAC_PUR_DAT:
$ open/write VAC_FILE_TMP 'VAC$DIR'VACATION.TMP
$ wri " Purging Old data from ''VAC$DIR'''VAC_DATA' - please wait"
$PUR_LP:
$ gosub RD_LINE
$ if LINE_TYP.eqs."" then goto PUR_FIN_UP
$ gosub DATE_CHK
$ if SWP_FLG.EQS."1".and.DAYS.gt.VAC$REM then goto PUR_LP
$ write VAC_FILE_TMP "''VAC_RD'"
$ goto PUR_LP
$PUR_FIN_UP:
$ close VAC_FILE
$ close VAC_FILE_TMP
$ rename 'VAC$DIR'VACATION.TMP 'VAC$DIR''VAC_DATA'
$ purge/nolog 'VAC$DIR''VAC_DATA'
$ gosub VAC_ENTS
$ exit
$VAC_ED_DAT:
$ on ERROR then goto EDT_ERR
$ open VAC_FILE 'VAC$DIR''VAC_DATA'
$ close VAC_FILE
$EDT_FILE:
$ assign /user_mode sys$command sys$input
$ VAC$EDIT 'VAC$DIR''VAC_DATA'
$ pur/nolog 'VAC$DIR''VAC_DATA'
$ rename 'VAC$DIR''VAC_DATA' 'VAC$DIR''VAC_DATA';1
$ wri ""
$ wri " VACATION.COM ''VAC_VRS'"
$ wri ""
$ gosub VAC_ENTS
$ exit
$EDT_ERR:
$ wri ""
$ wri " ''VAC$DIR'''VAC_DATA' does not exist, creating sample file"
$ open/write out_file 'VAC$DIR''VAC_DATA'
$ wrf "*''DATE_STP' Sample Countdown message (DELETE OR MODIFY THESE 4 LINES)"
$ wrf "_''DATE_ROUT'@Sample Reminder for this Date"
$ wrf "_''DATE_ROUT'-Sample Reminder for Today + 7 days prior"
$ wrf "_''DATE_ROUT'+Sample Reminder for Today + 7 days after"
$ close out_file
$ goto EDT_FILE
$VAC_ENTS:
$ open/read in_line 'VAC$DIR''VAC_DATA'
$ cnt=0
$ENT_LP:
$ read/end_of_file=ENT_END in_line test
$ if test.eqs."" then goto ENT_END
$ if f$ext(0,1,test).eqs."*" then cnt=cnt+1
$ goto ENT_LP
$ENT_END:
$ close in_line
$ if CNT.eq."0" then wri " ''VAC$DIR'''VAC_DATA' now contains ''esc'[1m''cnt'''esc'[0m Vacation entries"
$ if CNT.eq."1" then wri " ''VAC$DIR'''VAC_DATA' now contains entries for ''esc'[1m''cnt'''esc'[0m Vacation"
$ if CNT.gt."1" then wri " ''VAC$DIR'''VAC_DATA' now contains entries for ''esc'[1m''cnt'''esc'[0m different Vacations"
$ return
$OPEN_ERR:
$ wri " ''VAC$DIR'''VAC_DATA' does not exist
$ wrt
You must perform a 'Edit' command option prior to running VACATION.COM for
The first time, or the symbol VAC$DIR contains the wrong information, Type
'Help' or '?' command option for help (ie. VACATION Help)
$ exit
$VAC_HLP:
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #1"
$ wrt
send comments to Claude SALEM::BERUBE_C
requires VMS V4.4 or above
This .COM uses a User supplied ASCII file called VACATION.DAT (see
VACATION.COM for details on VACATION.DAT). VACATION.COM will remind
you of the number of days, hours, minutes and seconds 'till a vacation
as well as remind you of important dates surrounding a vacation.
In order to invoke VACATION.COM Define the following in your LOGIN.COM
$ VACATION:==@yourdisk:[youraccount]VACATION
VACATION.COM also uses the following symbols, which may be defined by
the user when running, they are as follows;
If you wish to have your VACATION.DAT contained in another directory
other than the default SYS$LOGIN, define the following in LOGIN.COM
$ VAC$DIR == "yourdisk:[youraccount]"
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #2"
$ wrt
If you wish to use your favorite editor, other than the default TPU,
then define the symbol VAC$EDIT in your LOGIN.COM. For example to use
SEDT as your editor define VAC$EDIT as follows
$ VAC$EDIT == "$SEDT$LIBRARY:SEDT"
If you wish to change the number of days all reminders will be
displayed preceding/after the date specified on the reminder line,
then define the symbol VAC$REM in your LOGIN.COM. For example to
change the default from 7 days preceding/after the date specified to 14
days preceding/after, define VAC$REM as follows
$ VAC$REM == "14"
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #3"
$ wri ""
$ wri " Invoke VACATION.COM ''VAC_VRS' by typing one of the following commands."
$ wrt
VACATION ? - - - - Prints this help message
VACATION Help- - - Prints this help message
VACATION - - - - - Run VACATION.COM with no special Screen output
VACATION Date nnnn Run VACATION.COM, bypassing the use of the VACATION.DAT
file, and uses nnnn as the date to compare with todays
date. NOTE nnnn must used either dd-mmm-yyyy or
"dd-mmm-yyyy hh:mm:ss" formats
VACATION Edit - - Edit VACATION.DAT file
VACATION Purge - - Purge VACATION.DAT of old data, based on VAC$REM value
VACATION BRief xxx Your can also disable the HH:MM:SS from the output of
VACATION.COM with the BRief Command. Where xxx is any
of the valid commands accepted by VACATION.COM (NOTE:
the Date command will take precedence over the BRief
command). VACATION.COM will assume the specified file
resides in the directory pointed to by the symbol
VAC$DIR.
VACATION Yearly - Ignore the Date field on reminder lines(ie dd-mmm-yyyy)
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #4"
$ wri " "
$ wri " Invoke VACATION.COM ''VAC_VRS' by typing one of the following Special Screen"
$ wri " output command."
$ wrt
VACATION All - - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_b'''e_r'''e_bl'''e_u'Bolded, Blinking, Underlined and Reverse Video''e_o'"
$ wrt
VACATION BLink - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_bl'Blinking''e_o'"
$ wrt
VACATION BOld - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_b'Bolded''e_o'"
$ wrt
VACATION None - - Run VACATION.COM with no special screen output
VACATION Reverse - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_r'Reverse Video''e_o'"
$ wrt
VACATION Under - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_u'Underlined''e_o'"
$ wri ""
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t'"
$ wri " VACATION.COM ''VAC_VRS' - Help Screen #5"
$ wri " "
$ wrt
It is also posible to cause VACATION.COM to read a user supplied data
file other than it default VACATION.DAT. To do so invoke VACATION.COM
as follows
VACATION File FILENAME.EXT xxxx xxxx
where File tells VACATION.COM to use the specified file other
than VACATION.DAT
FILENAME.EXT is any legal VMS filename, VACATION.COM will look in
the directory specified by VAC$DIR
xxxx xxxx is any of the valid commands combinations accepted
by VACATION.COM (NOTE the Date command will take
precedence over the BRief command) VACATION.COM will
assume the specified file resides in the directory
pointed to by the symbol VAC$DIR.
$ exit
|
73.10 | new version available | SALEM::BERUBE_C | Where do you think you are? WDW!! | Mon Jun 22 1992 11:27 | 33 |
| Well since there were several folks who seemed interested in counting
down in hours versus the default format that VACATION.COM does, Over
the weekend I have added a few features to aid in this, changed the
function of a couple of command options, and fixed a problem I had
meant to do a while ago.
From now on I'll be placing the latest version in a public directory
versus here in the conferrence, since the 2 files are somewhat large
in size for those of you using DECwindows Notes. Just copy the
following files to your account
SALEM::USER$DISK19:[BERUBE_C.MISC]VACATION.COM,VACATION.DOC
The new features etc for VACATION.COM V2.1 are
Added the Symbol Command Option to allow user to redefine the Global
Symbols VACATION.COM uses for execution. Added the VAC$THRES, VAC$DAYS
and VAC$HRS user definable Global symbols to define wether the
Countdown line output display format should change once the threshold
value of VAC$DAYS and/or VAC$THRS have been reached. (see section 3.11
of VACATION.DOC for more detail)
Change the meaning of the ? Command to now display the current values
of User Definable VAC$nnnn Global symbols.
Added the creation of Special Output Global Symbols for use upon
successful completion of VACATION.COM for use with other procedures
(see section 3.11.1 of VACATION.DOC for details)
Changed the meaning of the None command to run without the displaying
of any Countdown/Reminder lines for use with other procedures.
Fix it so the BRIEF command works with the DATE Command
|
73.11 | latest version of VACATION.COM | SALEM::BERUBE_C | Direct from this lamp...... | Wed Nov 11 1992 14:27 | 490 |
| $ goto START_PROGRAM !skip comments
VACATION.COM Version 2.2 by Claude SALEM::BERUBE_C
with code borrowed from Eric Osman's date/time subtract
routine which was published in UKCSSE::COMMAND_PROCEDURES
notes file, note 58.15
$START_PROGRAM:
$ gosub SETUP
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."S" then goto SET_SYMS
$ gosub SETUP2
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."H" then goto VAC_HLP
$ if f$ext(0,1,f$ed(P1,"upcase")).nes."N" then gosub PRGM_HDR
$ if P1.eqs."?" then goto DIS_SYMS
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."E" then goto VAC_ED_DAT
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then goto BYP_VAC_DAT
$ open/error=OPEN_ERR VAC_FILE 'VAC$DIR''VAC_DATA'
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."P" then goto VAC_PUR_DAT
$VAC_LP:
$ gosub RD_LINE
$ if LINE_TYP.eqs."" then goto VAC_FIN_UP
$ if LINE_TYP.eqs."BLANK" then goto VAC_LP
$ if LINE_TYP.EQS."*"
$ then
$ VAC_FLG="YES"
$ gosub DATE_CHK
$ gosub OUT_CNT
$ endif
$ if LINE_TYP.eqs."_" then gosub OUT_REM
$ goto VAC_LP
$VAC_FIN_UP:
$ if VAC_CNT.eq.0.and..not.NDATA then wri " There are Zero Vacations planned in ''VAC$DIR':VACATION.DAT"
$ if VAC_CNT.eq.0.and.NDATA.and..not.NOYR then wri " There are Zero Vacations planned in ''VAC$DIR':''VAC_DATA'"
$ if REM_CNT.eq.0.and.NDATA.and.NOYR then wri " There are No Yearly Reminders planned in ''VAC$DIR':''VAC_DATA'"
$ close VAC_FILE
$ exit
$OPEN_ERR:
$ wri " ''VAC$DIR'''VAC_DATA' does not exist
$ wrt
You must perform a VACATION Edit command prior to running VACATION.COM for
The first time, or the symbol VAC$DIR contains the wrong information, Type
VACATION Help for help or VACATION ? to view Global Symbol definitions.
$ exit
$VAC_PUR_DAT:
$ open/write VAC_FILE_TMP 'VAC$DIR'VACATION.TMP
$ wri " Purging Old data from ''VAC$DIR'''VAC_DATA' - please wait"
$PUR_LP:
$ gosub RD_LINE
$ if LINE_TYP.eqs."" then goto PUR_FIN_UP
$ gosub DATE_CHK
$ if SWP_FLG.EQS."1".and.DAYS.gt.VAC$REM then goto PUR_LP
$ write VAC_FILE_TMP "''VAC_RD'"
$ goto PUR_LP
$PUR_FIN_UP:
$ close VAC_FILE
$ close VAC_FILE_TMP
$ rename 'VAC$DIR'VACATION.TMP 'VAC$DIR''VAC_DATA'
$ purge/nolog 'VAC$DIR''VAC_DATA'
$ gosub VAC_ENTS
$ exit
$VAC_ED_DAT:
$ on ERROR then goto EDT_ERR
$ open VAC_FILE 'VAC$DIR''VAC_DATA'
$ close VAC_FILE
$EDT_FILE:
$ assign /user_mode sys$command sys$input
$ VAC$EDIT 'VAC$DIR''VAC_DATA'
$ pur/nolog 'VAC$DIR''VAC_DATA'
$ rename 'VAC$DIR''VAC_DATA' 'VAC$DIR''VAC_DATA';1
$ gosum PRGM_HDR
$ gosub VAC_ENTS
$ exit
$EDT_ERR:
$ wri " ''VAC$DIR'''VAC_DATA' does not exist, creating sample file"
$ open/write out_file 'VAC$DIR''VAC_DATA'
$ wrf "*''DATE_STP' Sample Countdown message (DELETE OR MODIFY THESE 4 LINES)"
$ wrf "_''DATE_ROUT'@Sample Reminder for this Date"
$ wrf "_''DATE_ROUT'-Sample Reminder for Today + 7 days prior"
$ wrf "_''DATE_ROUT'+Sample Reminder for Today + 7 days after"
$ close out_file
$ goto EDT_FILE
$DIS_SYMS:
$ gosub DIS_SYMS1
$ exit
$BYP_VAC_DAT:
$ if f$ext(0,2,f$ed(P3,"upcase")).eqs."BR" then BRIEF="YES"
$ VAC_RD="*"+f$ext(0,20,f$ed(P2,"upcase,compress"))
$ VAC_FLG="YES"
$ gosub DATE_CHK
$ gosub OUT_CNT
$ exit
$BYP_ERR:
$ wri " Date ""''p2'"" is prior to todays date, Please supply a Date"
$ wri " after Today'''s date, otherwise the countdown is meaningless"
$ exit
$!
$SET_SYMS:
$ if P2.eqs."" then goto SYM_SET_HLP
$ P2=f$ed(P2,"upcase,compress")
$ P3=f$ed(P3,"upcase,compress")
$ P4=f$ed(P4,"upcase,compress")
$ P5=f$ed(P5,"upcase,compress")
$ P6=f$ed(P6,"upcase,compress")
$ P7=f$ed(P7,"upcase,compress")
$ P8=f$ed(P8,"upcase,compress")
$ if P8.nes."N" then gosub PRGM_HDR
$ if P2.nes."".and.P2.nes."P" then VAC$DIR=="''P2'"
$ if P2.eqs."D" then VAC$DIR=="SYS$LOGIN:"
$ if P3.nes."".and.P3.nes."P" then VAC$EDIT=="''P3'"
$ if P3.eqs."D" then VAC$EDIT=="EDIT/TPU"
$ if P4.nes."".and.P4.nes."P" then VAC$REM==''P4'
$ if P4.eqs."D" then VAC$REM==7
$ if P5.nes."".and.P5.nes."P" then VAC$THRES=="''P5'"
$ if P5.eqs."D" then VAC$THRES=="NO"
$ if P6.nes."".and.P6.nes."P" then VAC$DAYS==''P6'
$ if P6.eqs."D" then VAC$DAYS==10
$ if P7.nes."".and.P7.nes."P" then VAC$HRS==''P7'
$ if P7.eqs."D" then VAC$HRS==48
$ if f$ext(0,1,f$ed(P8,"upcase")).nes."N" then gosub DIS_SYMS1
$ exit
$SYM_SET_HLP:
$ wri " In order to change the contents of the Global symbols used by"
$ wri " VACATION.COM ''VAC_VRS', issue the following command"
$ wri " "
$ wri " VACATION S [DIR] [EDIT] [REM] [THRES] {DAYS} {HRS} {None}"
$ wri ""
$ wri " where [DIR] = directory for .DAT data files (default SYS$LOGIN:)"
$ wri " [EDIT] = DCL editing command for .DAT files (EDIT/TPU)"
$ wri " [REM] = # of days to remind before/after (7)"
$ wri " [THRES] = Enable Threshold on output (NO)"
$ wri " {DAYS} = threshold value for Days (10, optional)"
$ wri " {HRS} = threshold value for Hours (48, optional)"
$ wri " {None} = disable output of Symbol notification (optional)"
$ wri ""
$ wri " D = accept the default (nnnn)"
$ wri " P = leave alone keep current value"
$ exit
$!
$SETUP:
$ VAC_VRS="V2.2"
$ VAC_FLG="YES"
$ VAC_CNT=0
$ REM_CNT=0
$ BRIEF="NO"
$ NOYR="NO"
$ NDATA="NO"
$ wri="write sys$output"
$ wrt="type sys$input"
$ wrf="write out_file"
$ return
$SETUP2:
$ if f$typ(VAC$DIR).nes."STRING" then VAC$DIR="SYS$LOGIN:"
$ if f$typ(VAC$EDIT).nes."STRING" then VAC$EDIT="EDIT/TPU"
$ if f$typ(VAC$REM).nes."INTEGER" then VAC$REM=7
$ if f$typ(VAC$THRES).nes."STRING" then VAC$THRES="NO"
$ if f$typ(VAC$DAYS).nes."INTEGER" then VAC$DAYS=10
$ if f$typ(VAC$HRS).nes."INTEGER" then VAC$HRS=48
$ VAC_DATA="VACATION.DAT"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."F" then NDATA="YES"
$ if NDATA
$ then
$ VAC_DATA="''P2'"
$ P1=P3
$ P2=P4
$ P3=P5
$ endif
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BR" then BRIEF="YES"
$ if BRIEF
$ then
$ P1=P2
$ P2=P3
$ endif
$ esc[0,7]=27
$ e_o="''esc'[0m"
$ e_b="''esc'[1m"
$ e_u="''esc'[4m"
$ e_bl="''esc'[5m"
$ e_r="''esc'[7m"
$ e_c = "''esc'[2J"
$ e_t = "''esc'[24A"
$ VAC$OUT="''e_o'"
$ if P1.eqs."".or.f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then goto CONT_SETUP
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."A" then VAC$OUT="''e_b'''e_u'''e_bl'''e_r'"
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BO" then VAC$OUT="''e_b'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."U" then VAC$OUT="''e_u'"
$ if f$ext(0,2,f$ed(P1,"upcase")).eqs."BL" then VAC$OUT="''e_bl'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."R" then VAC$OUT="''e_r'"
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."Y" then NOYR="YES"
$CONT_SETUP:
$ c="comparison"
$ TODAYS_DATE=f$ti ()
$ DATE_STP=f$ext(0,20,TODAYS_DATE)
$ if f$ext(0,1,TODAYS_DATE).eqs." " then DATE_STP="0"+f$ext(1,19,TODAYS_DATE)
$ if .not.NOYR
$ then DATE_REM=f$ext(0,11,DATE_STP)
$ else DATE_REM=f$ext(0,6,DATE_STP)
$ endif
$ DATE_ROUT=f$ext(0,11,DATE_STP)+" "
$ return
$PRGM_HDR:
$ wri ""
$ wri " VACATION.COM ''VAC_VRS'"
$ wri ""
$ return
$!
$!read line from VACATION.DAT or specified file for arrival date
$RD_LINE:
$ read/end_of_file=RD_EXIT VAC_FILE VAC_RD
$ LINE_TYP=f$ext(0,1,VAC_RD)
$ if LINE_TYP.eqs."" then LINE_TYP="BLANK"
$ return
$RD_EXIT:
$ LINE_TYP = ""
$ return
$!
$DATE_CHK:
$!Normalize sd to smaller than ld.
$ sd=f$cvt (DATE_STP, "absolute")
$ if .not.NOYR
$ then ld=f$cvt (f$ext (1,20,VAC_RD), "absolute")
$ else ld=f$cvt (f$ext (1,6,VAC_RD), "absolute")
$ endif
$ SWP_FLG=0
$ if f$cvt (sd, "comparison").les.f$cvt (ld, "comparison") then goto NO_SWP
$ SWP_FLG=1
$ t=sd
$ sd=ld
$ ld=t
$NO_SWP:
$!Define internal variables.
$ ldc=f$cvt (ld, c)
$!Calculate answer to nearest day.
$ l=10000
$ form="!AS- 0:0:0.0"
$ gosub ZERO_IN
$R1:
$ days=t
$!Calculate answer to nearest hour.
$ l=24
$ form="0- !AS:0:0.0"
$ gosub ZERO_IN
$R2:
$ hrs=t
$!Calculate to nearest minute.
$ l=60
$ form="0- 0:!AS:0.0"
$ gosub ZERO_IN
$R3:
$ min=t
$!Calculate to nearest second.
$ l=60
$ form="0- 0:0:!AS.0"
$ gosub ZERO_IN
$R4:
$ sec=t
$ return
$!Calculate to nearest hundreths.this section is not used
$ l=100
$ form="0- 0:0:0.!AS"
$ gosub ZERO_IN
$R5:
$ hun=t
$! Subroutine to zero in, given ranges and a form.
$ZERO_IN:
$ s=-1
$ new_t=(s + l)/2
$TRY_VAL:
$ t=new_t
$ if f$cvt (sd + "+''f$fao (form, f$string (t))'", c).les.ldc then -
goto TRY_LRG_VAL
$ new_t=(t + s)/2
$ if new_t.eq.t then goto VAl_DONE
$ l=t
$ goto TRY_VAL
$TRY_LRG_VAL:
$ new_t=(t + l)/2
$ if new_t.eq.t then goto VAl_DONE
$ s=t
$ goto TRY_VAL
$VAl_DONE:
$ sd=f$cvt (sd + "+''f$fao (form, f$string (t))'", "absolute")
$ return
$!
$!output the Vacation countdown number
$OUT_CNT:
$ if SWP_FLG.eq.1 then return
$ if SWP_FLG.eq.1.and.DAYS.gt.1 then VAC_FLG="NO"
$ if VAC_FLG.eqs."NO" then return
$ if SWP_FLG.eq.1.and.DAYS.eq.1 then DAYS=DAYS-1
$ VAC_CNT=VAC_CNT+1
$ days_'vac_cnt==days
$ hrs_'vac_cnt==hrs
$ min_'vac_cnt==min
$ thrs=(days*24)+hrs
$ thrs_'vac_cnt==thrs
$ tmin=(thrs*60)+min
$ tmin_'vac_cnt==tmin
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."N" then return
$ VAC_MSG=f$ext(22,50,VAC_RD)
$ if f$ext(0,1,f$ed(P1,"upcase")).eqs."D" then VAC_MSG="'till Date in question"
$ if VAC$THRES.and.DAYS.le.VAC$DAYS then goto OUT_CNT2
$ if .not.BRIEF
$ then
$ if DAYS.eq.1
$ then wri "''VAC$OUT' ''days' day, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ else wri "''VAC$OUT' ''days' days, ''hrs':''min':''sec' hh:mm:ss, ''VAC_MSG'''e_o'"
$ endif
$ else
$ if DAYS.eq.1
$ then wri "''VAC$OUT' ''days' day, ''VAC_MSG'''e_o'"
$ else wri "''VAC$OUT' ''days' days, ''VAC_MSG'''e_o'"
$ endif
$ endif
$ return
$ OUT_CNT2:
$ if THRS.le.VAC$HRS then goto OUT_CNT3
$ if .not.BRIEF
$ then
$ if THRS.eq.1
$ then wri "''VAC$OUT' ''thrs' hr, ''min' mins, ''sec' secs ''VAC_MSG'''e_o'"
$ else wri "''VAC$OUT' ''thrs' hrs, ''min' mins, ''sec' secs ''VAC_MSG'''e_o'"
$ endif
$ else
$ if THRS.eq.1
$ then wri "''VAC$OUT' ''thrs' hr, ''VAC_MSG'''e_o'"
$ else wri "''VAC$OUT' ''thrs' hrs, ''VAC_MSG'''e_o'"
$ endif
$ endif
$ return
$ OUT_CNT3:
$ if .not.BRIEF
$ then
$ if TMIN.eq.1
$ then wri "''VAC$OUT' ''tmin' min, ''sec' secs ''VAC_MSG'''e_o'"
$ else wri "''VAC$OUT' ''tmin' mins, ''sec' secs ''VAC_MSG'''e_o'"
$ endif
$ else
$ if TMIN.eq.1
$ then wri "''VAC$OUT' ''tmin' min, ''VAC_MSG'''e_o'"
$ else wri "''VAC$OUT' ''tmin' mins, ''VAC_MSG'''e_o'"
$ endif
$ endif
$ return
$!
$!check for important reminder dates etc.
$OUT_REM:
$ if VAC_FLG.eqs."NO" then return
$ if .not.NOYR then VAC_DATE=f$ed(f$ext(1,11,VAC_RD),"UPCASE")
$ if NOYR then VAC_DATE=f$ed(f$ext(1,6,VAC_RD),"UPCASE")
$ if f$ext(21,1,VAC_RD).eqs."@" then goto RMD_ACTUAL
$ if f$ext(21,1,VAC_RD).eqs."+" then goto RMD_AFTER
$ if f$ext(21,1,VAC_RD).eqs."-" then goto RMD_BEFORE
$ return
$RMD_ACTUAL:
$ if VAC_DATE.nes.DATE_REM then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ REM_CNT=REM_CNT+1
$ return
$RMD_AFTER:
$ gosub DATE_CHK
$ if DAYS.gt.VAC$REM then return
$ if SWP_FLG.eq.0 then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ REM_CNT=REM_CNT+1
$ return
$RMD_BEFORE:
$ gosub DATE_CHK
$ VAC$REM1=VAC$REM-1
$ if DAYS.gt.VAC$REM1 then return
$ if SWP_FLG.eq.1.and.days.ge.1 then return
$ VAC_MSG=f$ext(22,70,VAC_RD)
$ wri "''VAC$OUT' ''VAC_MSG'''e_o'"
$ REM_CNT=REM_CNT+1
$ return
$VAC_ENTS:
$ open/read in_line 'VAC$DIR''VAC_DATA'
$ cnt=0
$ENT_LP:
$ read/end_of_file=ENT_END in_line test
$ if test.eqs."" then goto ENT_END
$ if f$ext(0,1,test).eqs."*" then cnt=cnt+1
$ goto ENT_LP
$ENT_END:
$ close in_line
$ if CNT.eq."0" then wri " ''VAC$DIR'''VAC_DATA' now contains ''esc'[1m''cnt'''esc'[0m Vacation entries"
$ if CNT.eq."1" then wri " ''VAC$DIR'''VAC_DATA' now contains entries for ''esc'[1m''cnt'''esc'[0m Vacation"
$ if CNT.gt."1" then wri " ''VAC$DIR'''VAC_DATA' now contains entries for ''esc'[1m''cnt'''esc'[0m different Vacations"
$ return
$DIS_SYMS1:
$ wri " Currently your VAC$nnnn Global Symbols are defined as"
$ wri ""
$ wri " VAC$DIR = ''VAC$DIR', directory for .DAT data files"
$ wri " VAC$EDIT = ''VAC$EDIT', editor to use when editing .DAT files"
$ wri " VAC$REM = ''VAC$REM', # of days to remind before/after"
$ wri " VAC$THRES = ''VAC$Thres', (YES/NO) Change output display when Threshold is met"
$ wri " VAC$DAYS = ''VAC$DAYS', threshold value for Days display"
$ wri " VAC$HRS = ''VAC$HRS', threshold value for Hours display"
$ RETURN
$VAC_HLP:
$ wri "''e_c'''e_t' VACATION.COM ''VAC_VRS' - Help Screen #1"
$ wrt
send comments to Claude SALEM::BERUBE_C
This .COM uses a User supplied ASCII file called VACATION.DAT (see
VACATION.DOC for details on VACATION.DAT). VACATION.COM will remind
you of the number of days, hours, minutes and seconds 'till a vacation
as well as remind you of important dates surrounding a vacation.
In order to invoke VACATION.COM Define the following in your LOGIN.COM
$ VACATION:==@yourdisk:[youraccount]VACATION
To change the Global symbols defaults that VACATION.COM will use to
determine how it executes, Run VACATION.COM as follows
VACATION Symbol [DIR] [EDIT] [REM] [THRES] {DAYS} {HRS} {None}
where [DIR] = directory for .DAT data files (default SYS$LOGIN:)
[EDIT] = DCL editing command for .DAT files (default EDIT/TPU)
[REM] = # of days to remind before/after (default 7)
[THRES] = Enable Threshold on output (default NO)
{DAYS} = threshold value for Days (default 10, optional)
{HRS} = threshold value for Hours (default 48, optional)
{None} = disable output of Symbol Notification (optional)
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t' VACATION.COM ''VAC_VRS' - Help Screen #2"
$ wri ""
$ wri " Invoke VACATION.COM ''VAC_VRS' by typing one of the following commands."
$ wrt
VACATION ? - - - - Displays values of all User Definable VAC&nnnn symbols
VACATION Help- - - Displays this help message
VACATION - - - - - Run VACATION.COM with no special Screen output(default)
VACATION BRief xxx Your can also disable the HH:MM:SS from the output of
VACATION.COM with the BRief Command. Where xxx is any
of the Special Screen output commands.
VACATION Date nnnn Run VACATION.COM, bypassing the use of the VACATION.DAT
file, and uses nnnn as the date to compare with todays
date. NOTE nnnn must used either dd-mmm-yyyy or
"dd-mmm-yyyy hh:mm:ss" formats
VACATION Edit - - Edit VACATION.DAT file, if file doesn' t exist then
create a dummy one using todays dates as examples.
VACATION None- - - Run VACATION.COM with no Countdown/Reminder Line output
VACATION Purge - - Purge VACATION.DAT of old data, based on VAC$REM value
VACATION Yearly - Ignore the Date field on reminder lines(ie dd-mmm-yyyy)
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t' VACATION.COM ''VAC_VRS' - Help Screen #3"
$ wri " "
$ wri " Invoke VACATION.COM ''VAC_VRS' by typing one of the following Special Screen"
$ wri " output command."
$ wrt
VACATION All - - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_b'''e_r'''e_bl'''e_u'Bolded, Blinking, Underlined and Reverse Video''e_o'"
$ wrt
VACATION BLink - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_bl'Blinking''e_o'"
$ wrt
VACATION BOld - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_b'Bolded''e_o'"
$ wrt
VACATION Reverse - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_r'Reverse Video''e_o'"
$ wrt
VACATION Under - - Run VACATION.COM with the Countdown/Reminder messages
$ wri " ''e_u'Underlined''e_o'"
$ wri ""
$ inq MORE_HELP " Press <CR> to continue Help"
$ wri "''e_c'''e_t' VACATION.COM ''VAC_VRS' - Help Screen #4"
$ wri " "
$ wrt
It is also possible to cause VACATION.COM to read a user supplied data
file other than it's default VACATION.DAT. To do so invoke VACATION.COM
as follows
VACATION File FILENAME.EXT xxxx xxxx
where File tells VACATION.COM to use the specified file other
than it's default VACATION.DAT
FILENAME.EXT is any legal VMS filename, VACATION.COM will look in
the directory specified by VAC$DIR, (default is
SYS$LOGIN)
xxxx xxxx is any of the valid commands combinations accepted
by VACATION.COM.
***NOTE FOR MORE DETAILED HELP ON VACATION.COM USAGE SEE VACATION.DOC***
$ exit
|
73.12 | latest version of VACATION.DOC | SALEM::BERUBE_C | Direct from this lamp...... | Wed Nov 11 1992 14:34 | 562 |
|
VACATION.COM Version 2.2
by Claude SALEM::BERUBE_C
(with code borrowed from Eric Osman's date/time subtract
routine which was published in UKCSSE::COMMAND_PROCEDURES
notes file, note 58.15)
The latest version as well as some tips on usage can always
be found in topic #73 of the CLOSET::DISNEY conference.
VACATION.DOC page 2
Table Of Contents
1.0 Getting Started.............................. 3
2.0 VACATION.DAT File............................ 4
2.1 Countdown Lines......................... 4
2.2 Reminder Lines.......................... 5
2.3 Sample VACATION.DAT file................ 5
3.0 Using VACATION.COM........................... 6
3.1 ? Command Option........................ 6
3.2 BRief Command Option.................... 6
3.3 Date Command Option..................... 6
3.4 Edit Command Option..................... 6
3.5 File Command Option..................... 7
3.6 Help Command Options.................... 7
3.7 None Command Option..................... 7
3.8 Purge Command Option.................... 7
3.9 Yearly Command Option................... 7
3.10 Special Screen Display Output Commands.. 8
3.10.1 All Command Option.............. 8
3.10.2 BLink Command Option............ 8
3.10.3 BOld Command Option............. 8
3.10.4 Reverse Command Option.......... 8
3.10.5 Under Command Option............ 8
3.11 Global Symbol Command Option............ 8
3.11.1 Special Output Global Symbols.... 10
4.0 Revision History............................. 11
VACATION.DOC page 3
1.0 GETTING STARTED.
This .COM file uses a User supplied ASCII file called VACATION.DAT (see
section 2.0 below for details on VACATION.DAT). VACATION.COM will
remind you of the number of days, hours, minutes and seconds 'till a
vacation as well as remind you of important dates surrounding a
vacation.
NOTE: It is recommended that you use the 'Edit' command option when
you invoke for the first time, since VACATION.COM will create a Sample
VACATION.DAT file for you, that you can then Delete or Modify to your
own requirements
In order to run VACATION.COM, define the following in your LOGIN.COM
$ VACATION:==@yourdisk:[youraccount]VACATION
If you do not wish to use the defaults for the Global Symbols used by
VACATION.COM to determine how it executes, see section 3.11 on page 8
for more detailed help on the use of the Globals Symbols for
VACATION.COM and the Symbol command option usage
VACATION.COM has built in Help, to view simply type
VACATION Help
for online help on the use of VACATION.COM and it's associated commands
VACATION.DOC page 4
2.0 VACATION.DAT FILE.
VACATION.COM reads a user supplied ASCII text file called VACATION.DAT
(or the user may specify a different file other than the default
VACATION.DAT, do a VACATION H for on line help or see sec. 3.5 for
details) which contains lines in the following 2 formats.
*dd-mon-yyyy hh:mm:sscxxx... <- this is the countdown line format
_dd-mon-yyyy cxxx... <- this is the reminder line format
NOTE #1: It is OK to have more than one COUNTDOWN line (vacation date)
in your VACATION.DAT file providing all REMINDER lines follow their
corresponding COUNTDOWN lines
NOTE #2: It is recommended to you use the 'Edit' command option when
you invoke for the first time, since VACATION.COM will create a Sample
VACATION.DAT file for you, that you can then Delete or Modify to your
own requirements
2.1 COUNTDOWN LINES.
Character Lines must use the following format.
*dd-mon-yyyy hh:mm:sscxxx... <- this is the countdown line format
where
* = (Character position 1) this tells VACATION.COM to
display the numbers of days, hours, minutes and
seconds left for a given upcoming vacation, based
on characters #2 thru 21
dd-mon-yyy hh:mm:ss = (Characters 2-21) which is the upcoming date/time
field that VACATION.COM will compare today's date
to and tell you the remaining days, hours,
minutes and seconds left. Characters #2 thru 21
must be in the following format dd-mmm-yyyy
hh:mm:ss (ie. 02-JUL-1989 12:30:00).
c = (Character 22) is unsused at this time.
xxx... = (Characters 23-73) Starting at character #23 on,
the remainder of the countdown line, is the
message to be displayed with the count (max of 50
characters in length, this is so it'll display
correctly on a 80 column display properly).
VACATION.DOC page 5
2.2 REMINDER LINES.
Reminder lines must use the following format,
_dd-mon-yyyy cxxx... <- this is the reminder line format
where,
_ = (Character position 1) this tells VACATION.COM, that the
remainder of the line is to be used for reminders based
on the date field (character #2 thru 12 of the reminder
line (NOTE characters 13-21 are unused at his time) and
the reminder symbol (character #22 of the reminder line).
dd_mon_yyy = (Characters 2-12) is used for the date you wish to be
reminded of an activity, and must be in the dd-mmm-yyyy
format (ie. 02-JUL-1989).
(NOTE characters 8-12 will be ignored if the Yearly
command is specified on the command line, and characters
13-21 are unused and should be blanks).
c = (Character 22) must be one of the following symbols
@ = Print this reminder message only on this date only
+ = Print this reminder message on this date and the # of
days following this date specified by the symbol
VAC$REM (default is 7). (this is good for reminder
yourself on the earliest date in wish to make a
certain dinner reservation etc)
- = Print this reminder message on this date and the
preceding # of days specified by the symbol VAC$REM
prior to this date (default is 7). (this is good for
reminding you of a due date for payment etc)
xxx... = (Characters 23-73) Starting at character #23 on, the
remainder of the reminder line, is the message to be
displayed (max of 50 characters in length, this is so
it'll display correctly on a 80 column display properly).
2.3 SAMPLE VACATION.DAT FILE.
Below is a sample VACATION.DAT file (I think you get the idea)
*30-NOV-1989 12:30:00 Sample Countdown message (DELETE OR MODIFY THESE 4 LINES)
_30-NOV-1989 @Sample Reminder for this Date
_30-NOV-1989 -Sample Reminder for Today and 7 days prior
_30-NOV-1989 +Sample Reminder for Today and 7 days after
VACATION.DOC page 6
3.0 USING VACATION.COM.
After you have defined the various symbols etc. as specified in
section 1, and created your specific VACATION.DAT as described in
section 2, you are now ready to use VACATION.COM. There are a variety
of ways to invoke, but the easiest is by typing the command VACATION
followed by a carriage return, when the user does this VACATION.COM
will display the Countdown and Reminder messages using the default
display settings.
VACATION.COM will also accept the following command options as follows;
3.1 ? Command Option.
The '?' command option is used to have VACATION.COM display the value
of the user definable VAC$nnnn Global symbols.
3.2 BRief Command Option.
The 'BRief' command option is used for the disabling of the HH:MM:SS
portion of the default output or the Minutes/Seconds portion of the
display when VAC$THRES="YES" from VACATION.COM. The 'BRief' command
option uses the following format;
VACATION BRief xxx
Where xxx is any of the valid commands accepted by VACATION.COM
3.3 Date Command Option.
The 'Date' command option is used by VACATION.COM, to bypass the use of
it's default VACATION.DAT file, and uses the date supplied to compare
with todays date. The 'Date' command option uses the following format;
VACATION Date nnnn
NOTE nnnn must use either dd-mmm-yyyy or "dd-mmm-yyyy hh:mm:ss" formats
3.4 Edit Command Option.
The 'Edit' command option is used by VACATION.COM to edit the
VACATION.DAT file, if file does not exist then create a sample one
using todays dates as examples for the Countdown and Reminder lines.
NOTE VACATION.COM will use TPU as the editor and look for VACATION.DAT
in your SYS$LOGIN directory, unless you had defined VAC$EDIT and
VAC$DIR accordingly in your LOGIN.COM.
VACATION.DOC page 7
3.5 File Command Option.
The 'File' command option is used in causing VACATION.COM to read a
user supplied data file other than it's default VACATION.DAT. To do so
invoke VACATION.COM as follows
VACATION File FILENAME.EXT xxxx xxxx
where
File tells VACATION.COM to use the specified file other
than it's default VACATION.DAT
FILENAME.EXT is any legal VMS filename, VACATION.COM will look in
the directory specified by VAC$DIR, (default is
SYS$LOGIN)
xxxx xxxx is any of the valid commands combinations accepted by
VACATION.COM.
3.6 Help Command Option.
The 'Help' command option is used to have VACATION.COM display it's
built in help messages.
3.7 None Command Option.
The 'None' command option is are used to have VACATION.COM run without
displaying any Coutndown/Reminder lines. this is useful for when using
VACATION.COM Global Symbol creation for use with other command
procedure in which case the output isn't desired.
3.8 Purge Command Option.
The 'Purge' command option is used for purging VACATION.DAT of old
data, based on the value of VAC$REM (default is 7 days)
3.9 Yearly Command Option.
The 'Yearly' command option is to ignore the Date field on reminder
lines (ie dd-mmm-yyyy). This is useful for reminding yourself of
Birthday's and Anniversaries etc. that fall on the same date each
year.
VACATION.DOC page 8
3.10 Special Screen Display Output Commands.
VACATION.COM also allows the use of special screen display commands
options that affect the displaying of output from VACATION.COM. The
Special Screen Display Output Commands are as follows; (NOTE: you may
wish to do a VACATION Help command and pay particular attention to Help
screen # 4 to see how these commands work)
3.10.1 All Command Option.
The 'All' command option will cause VACATION.COM to display it's
Countdown and Reminder output messages in Bolded, Blinking, Underlined
and Reverse Video text.
3.10.2 BLink Command Option.
The 'BLink' command option will cause VACATION.COM to display it's
Countdown and Reminder output messages Blinking text.
3.10.3 BOld Command Option.
The 'BOld' command option will cause VACATION.COM to display it's
Countdown and Reminder output messages in Bolded text.
3.10.4 Reverse Command Option.
The 'Reverse' command option will cause VACATION.COM to display it's
Countdown and Reminder output messages in Reverse Video text.
3.10.5 Under Command Option
The 'Under' command option will cause VACATION.COM to display it's
Countdown and Reminder output messages in Underlined text.
3.11 Symbol Command Option
The 'Symbol' command option will cause the defining of the Global
Symbols used by VACATION.COM to determine program execution parameters.
The Global Symbols used by VACATION.COM and the functions are
VAC$DIR = Directory for .DAT data files (default SYS$LOGIN:). You can
change this to the physical directory name or a logical
name in which VACATION.COM will look for VACATION.DAT and
any other .DAT files with the File Command. This is useful
is you wish to store data file for various command
procedures etc. in a common directory other than
SYS$LOGIN:
VACATION.DOC page 9
VAC$EDIT = DCL editing command for .DAT files (default EDIT/TPU). The
value of VAC$EDIT will be used by VACATION.COM to edit
VACATION.DAT or other .DAT files with the. This is useful
when you wish to use an editor other than the default
EDIT/TPU. To cahnge this for use with SEDT define as
$SEDT$LIBRARY:SEDT
VAC$REM = # of days to remind before/after a given reminder date
(default 7, must be an Integer value).
VAC$THRES = Enable Threshold checking on output of Countdown Lines
(default NO). Set this to YES if you wish for the Values
of VAC$DAYS and VAC$HRS to affect the ouput of VACATION.COM
once you are close to a VACATION.
VAC$DAYS = Threshold value for Days and Hours (default VAC$DAYS=10,
VAC$HRS VAC$HRS=48 optional). These symbol values will cause the
output of Countdown lines to change once the value of DAYS
left is less than or eqaul the value of VAC$DAYS and/or
THRS is less than or equal the value of VAC$HRS when
VAC$THRES=YES. When condition is met, Countdown Lines will
change from the Default of
xxx days, xx:xx:xx hh:mm:ss, message <- Default format
xxx days, message <- Brief format
format to that of
xxx hours, xxx mins, xxx sec, message <- Default Format
xxx hours, message <- Brief Format
when DAYS is less than or equal to VAC$DAYS, and will
further change to
xxx mins, xxx sec, message <- Default Format
xxx mins, message <- brief Format
when DAYS is less than or equal to VAC$DAYS.
To change the Global symbol defaults, define the following in your
LOGIN.COM, or execute from the VMS $ prompt
$ VACATION Symbol [DIR] [EDIT] [REM] [THRES] {DAYS} {HRS} {NONE}
where [DIR] = directory for .DAT data files (default SYS$LOGIN:)
[EDIT] = DCL editing command for .DAT files (default EDIT/TPU)
[REM] = # of days to remind before/after (default 7)
[THRES] = Enable Threshold on output (default NO)
{DAYS} = threshold value for Days (default 10, optional)
{HRS} = threshold value for Hours (default 48, optional)
{NONE} = disable output of Symbol Notification (optional)
If you wish to accept either the Default or the Previous value of the
symbol then replace the above paramaters with either
D = accept the default (nnnn)"
P = leave alone keep current value"
VACATION.DOC page 10
For example, to run VACATION.COM to look in a specific directory for
VACATION.DAT and accept the defaults for the other symbols do a
VACATION S JUNK: d d d d d
3.11.1 Special Output Global Symbols
VACATION.COM will create special output GLOBAL symbols upon successful
completion, that can later be used by other command procedures. For
example you might wish to change your VAXMail personal name to include
the count etc on a daily basis.
The Global symbols created are DAYS_n, HRS_n, MIN_n, THRS_n and TMIN_n
for each of the vacation entryies in VACATION.DAT (or file is
specified), where n is equal to the countdown line entry in
VACATION.DAT. For example a VACATION.DAT file with 2 different
Countdown lines will create
DAYS_1 = Total number of days left for first Countdown line found
in VACATION.DAT
DAYS_2 = Total number of days left for second Countdown Line....
HRS_1 = Total number of hours left for first Countdown line...
HRS_2 = Total number of hours left for second Countdown Line..
.
The discription of the special output Global symbols are as follows
DAYS_n = Equal to # of Days left as displayed by VACATION.COM
default output for Countdown Lines.
HRS_n = Equal to # of Hours left as displayed by VACATION.COM
default output for Countdown Lines.
MIN_n = Equal to # of Minutes left as displayed by VACATION.COM
default output for COuntdown Lines.
THRS_n = SUM of (DAYS_n*24)+HRS_n
TMIN_n = SUM of (THRS_n*60)+MIN_n
VACATION.DOC page 11
4.0 Revision history:
06-APR-89 V1.0 Initial DISNEY.COM Release, actually coded in '86 but
forget the date
06-APR-89 V1.1 Added Eric Osmon's code to make Disney.Com run faster,
and have Disney.Dat contain less data
07-APR-89 V1.2 Added BOld/BLink etc. commands, added feature to
prompt upto 7 days prior/after reminder date, renamed
files to VACATION.COM and VACATION.DAT
10-APR-89 V1.3 Fixes bug with DATE_STAMP
17-APR-89 V1.4 Fixed a few logic bugs, eliminate the printing of old
data
27-NOV-89 V1.5 Added the Purge command to purge old data in
VACATION.DAT, also added the ? and H command for help
message, and instructions on use at end of file
30-NOV-89 V1.6 Fixed logic for determining command parser, allow for
minimum number of characters to be typed, added command
Edit to allow users to edit VACATION.DAT from within
VACATION.COM, added symbol VAC$EDIT to specify editor
to use, also create a sample VACATION.DAT file when not
found, when doing a VACATION Edit command
08-MAR-90 V1.7 Added logic to display the remaining hours, minutes,
seconds in addition to days. This feature is not used
on reminder lines at this time.
07-FEB-91 V1.8 Added Date command, to accept P2 as the countdown date
to compare today's date to, thereby bypassing the need
for a VACATION.DAT file, useful when first planning a
vacation, must be in the format of dd-mmm-yyy or
"dd-mmm-yyy hh:mm:ss". Also edited help message to
point to my new node.
01-JUN-91 V1.9 Added File command, to force VACATION.COM to use
another file other than VACATION.DAT, assumes file is
located in the directory pointed to by the VAC$DIR
symbol (default is SYS$LOGIN). Added the assigning of
symbol DAYS for use by other procedures, this symbol
will contain the number of Days left prior to the LAST
vacation listed in VACATION.DAT or file specified at
the completion of VACATION.COM execution.
07-JUL-91 V1.10 Added the BRief Command, this will cause VACATION.COM
to not display the HH:MM:SS left.
VACATION.DOC page 12
04-DEC-91 V1.11 Added the Yearly command to ignore the Year field (ie
dd-mmm-yyyy) on Reminder lines, this is useful for
being reminded on yearly occasions of upcoming events
such as Holidays, Birthday etc. that occur on the same
day each year. Also added the Symbol VAC$REM for
allowing the user to change the default of 7 days for
the notification of reminders.
23-APR-92 V1.12 Fix code for parsing VACATION.DAT to allow for blank
lines.
15-MAY-92 V2.0 Added code to output message when there are no
vacations or yearly reminders planned in the future.
Removed text from VACATION.COM and created
VACATION.DOC, and release to TOOLSHED.
22-JUN-92 V2.1 Added the creation of Global Symbols ( see section
3.11.1) for use upon upon successful completion of
VACATION.COM.
Change the meaning of the None command to run without
the displaying of any Countdown/Reminder lines for use
with other procedures
Change the meaning of the ? Command to display the
values of User Definable VAC$nnnn Global symbols.
Added the VAC$THRES, VAC$DAYS and VAC$HRS user
definable Global symbols to define wether the Countdown
line output display format should change once the
threshold value of VAC$DAYS and VAC$THRS have been
reached.
Added the Symbol Command Option to allow user to
redefine the Global Symbols VACATION.COM uses for
execution.
Fix it so the BRIEF command works with the DATE Command
22-JUL-92 V2.2 Fixed bug around displaying countdown lines the day
after a vacation starts.
|
73.13 | | VMSNET::S_VORE | Smile - Mickey's Watching! | Fri Feb 28 1997 09:15 | 8 |
| as an aside (this appeared to be the closest topic)...
http://pluto.njcc.com/~csink/disney.htm has a little program that sits
in the tray on Win95 or NT4 and lets you see how long 'til your next
visit.
-Steven
(127 days, 5 hours, 50 minutes to go (that's 10993839 seconds!))
|