Announcement

Collapse
No announcement yet.

IsHoliday Script (txt)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bill Brower
    replied
    Cool - I did something a long time ago before I went to an Outlook based setup.

    Put the INI file into your config directory and the ASP file in the html directory.
    It is a little different format than what you are using but you probably can adapt it easily.
    You'll need to go into the INI manually to delete old entries if you want.

    This is what goes into the INI file:
    [2/3/2004]
    Bill=off
    [4/7/2010]
    Bill=off
    Candy=off



    Also: when coding your HS directory try it like this that way your script will work from any HS2 directory location:
    path = hs.GetAppPath
    path = path & "\config\daysoff.ini"
    Attached Files

    Leave a comment:


  • sdanks
    started a topic IsHoliday Script (txt)

    IsHoliday Script (txt)

    Here is a script I had alot of trouble with, so I will share it so someone else might find it useful.

    Setup a file in the config directory called holidays.txt

    it should contain lines that have the date of your holidays

    like:

    1/1/2010
    1/18/2010
    5/31/2010
    7/5/2010
    9/6/2010
    10/11/2010
    11/11/2010
    12/24/2010

    Then, in your script where you want to know if today is a holiday, put the following:

    ' Get Check to see if today is a holiday ((holidays.txt in Config Folder)
    if (hs.runex("isholiday.txt","Is_Holiday","test")) = "FALSE" then
    'Run the script, otherwise dont run it because today is a holiday.

    ..do some stuff if today is not a holiday

    end if

    The Is_holiday.txt script needs to be in the scripts folder.

    have fun. This is also a good example of how to call one script from another and pass back a return value.

    -Scott
    Attached Files
    Last edited by sdanks; June 22, 2010, 09:19 PM.
Working...
X