Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2004
    Posts
    17

    Running a task on a random schedule

    I'm trying to find a way to run a file on a random day after the user enters the CD to remind them to complete a form. I have a simple batch file that I can run from an at job that will create a pop-up message similar to using Dialog.Message, but I don't want everyone in the company submitting their forms all at once. What I cant seem to figure out is how to add a random number of days to System.GetDate and then use that date to create the at statement in a text file, then rename the text file as a .bat and run it. Ideally, I would like to limit the reminder to a minimum of 15 days and a maximum of 60.

    Anyone have any ideas???
    Last edited by Brunzwick; 12-08-2004 at 04:06 PM.

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Maybe you could adapt this to do what need.

    This generates a random number between 15 and 60, and then adds it to todays date using a couple functions that convert the current date to Julian, then adds the days, then converts back to Gregorian.
    Attached Files

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by Worm
    Maybe you could adapt this to do what need.

    This generates a random number between 15 and 60, and then adds it to todays date using a couple functions that convert the current date to Julian, then adds the days, then converts back to Gregorian.
    Worm, You amaze me sometimes. The formulas you come up with are too cool.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Oh how I wish it were true Tig.

    I guess the best you could be is impressed with my Google Searching Skills

    http://aa.usno.navy.mil/faq/docs/JD_Formula.html

  5. #5
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Don't knock it, Google's advanced search features have been my primary secret weapon for years.

  6. #6
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Hopefully I didn't demystify your expertise. Maybe we can delete the post before everyone reads it and figures out yours and Coreys secret weapon.

    Ok he is still in the bag


    Tigg
    Last edited by TJ_Tigger; 12-09-2004 at 08:13 AM.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  7. #7
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    *That* kind of thinking will get you places. Just don't forget us wee people, for we Googlers are a stout but loyal lot.

Similar Threads

  1. Random text from tables.
    By MIchaelD in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 09-20-2004, 09:36 AM
  2. Random audio from tables
    By MIchaelD in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 09-08-2004, 06:57 PM
  3. System Tray? & Task Bar? Ideas?
    By Tux in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 04-06-2004, 12:44 AM
  4. shut down process in task manager?
    By thesven in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 08-20-2003, 12:00 PM
  5. Need Assistance with Random Question Quiz
    By marc3515 in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 02-16-2003, 06:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts