HP3000-L Archives

December 2004, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Greg Stigers <[log in to unmask]>
Reply To:
Greg Stigers <[log in to unmask]>
Date:
Thu, 2 Dec 2004 23:03:26 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (62 lines)
In the following, I want to set HOLIDAY to false when none of the conditions
are true. I originally set it to false first, then let the tests set it to
true as needed. I later decided to try moving it within the various tests,
and failed. Is there a better way to do this? For instance, should I include
the HPMONTH test as part of all the conditions under its test, instead of
nesting them?

#In January, test for New Year's Day and the day after on a Monday
IF !HPMONTH = 1
   IF !HPDATE = 1
      SETVAR HOLIDAY TRUE
#Test for Monday after New Year's Day when New Year's Day falls on Sunday
   ELSEIF !HPDATE = 2 AND !HPDAY = 2
      SETVAR HOLIDAY TRUE
   ENDIF
#Test for Memorial Day
ELSEIF !HPMONTH = 5 AND !HPDAY = 2 AND !HPDATE >= 25
   SETVAR HOLIDAY TRUE
#Test for Fourth of July or Friday the 3rd or Saturday the 5th
ELSEIF !HPMONTH = 7
   IF !HPDAY = 4
      SETVAR HOLIDAY TRUE
#Test for Friday the 3rd of July when the Fourth is a Saturday
   ELSEIF !HPDAY = 6 AND !HPDATE = 3
      SETVAR HOLIDAY TRUE
#Test for Monday the fifth of July when the Fourth of July is Sunday
   ELSEIF AND !HPDAY = 2 AND !HPDATE = 5
      SETVAR HOLIDAY TRUE
   ENDIF
#Test for Labor Day, in September, Monday, of the first week
ELSEIF !HPMONTH = 9 AND !HPDAY = 2 AND !HPDATE <= 7
   SETVAR HOLIDAY TRUE
#Test for Thanksgiving, November, Thursday, fourth week
ELSEIF !HPMONTH = 11 AND !HPDAY = 5 AND !HPDATE >=21 AND !HPDATE <= 27
   SETVAR HOLIDAY TRUE
#In December: Christmas Eve, Christmas, Monday 26th & Saturday New Year's
Eve
ELSEIF !HPMONTH = 12
#Test for Christmas Eve on a Friday when Christmas is a Saturday
   IF !HPDATE = 24 AND !HPDAY = 6
      SETVAR HOLIDAY TRUE
#Test for Christmas Day
   ELSEIF !HPDATE = 25
      SETVAR HOLIDAY TRUE
#Test for the Monday after Christmas when Christmas is on a Sunday
   ELSEIF !HPDATE = 26 AND !HPDAY = 2
      SETVAR HOLIDAY TRUE
#Test for New Year's Eve Friday when New Year's Day falls on Saturday
   ELSEIF !HPDATE = 31 AND !HPDAY = 6
      SETVAR HOLIDAY TRUE
   ENDIF
ELSE
   SETVAR HOLIDAY FALSE
ENDIF
#Show the result
SHOWVAR HOLIDAY

Greg Stigers

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2