Announcement

Collapse
No announcement yet.

project timer

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

  • project timer

    All,

    we are using our AMS to automate some processes. We would like to have the user input a stop time for the project. For instance, the user enters 11 PM into an edit field. A comparison to the system clock is made. When 11 PM comes around, the project closes. Kind of a sleep timer, I guess.

    There is something about condition statements that I just can't grasp. Would any of you have a suggestion on how to implement this function?

    Thanks!

    Peter


  • #2
    Re: project timer

    Peter,
    You can use system<GetDateTime action to put the system time in a variable. Then check the given time (that the user typed in a text field) and compare the two. Based on the result, use application<exit action to stop project.
    Good luck
    Yossi

    Comment


    • #3
      Re: project timer

      You'll also have to put this script/code in a timer of some sort. There have been several different methods posted in the forum for timers. There is a Flash Timer, a javascript timer that runs in an Explorer Object, and the old standy by Silent MP3.

      Comment


      • #4
        Re: project timer

        Silent MP3 doesn't apply here...

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment


        • #5
          Re: project timer

          I agree its not the best answer, but you could use the 1 sec silent mp3 with repeat to check the time.

          Comment


          • #6
            Re: project timer

            The problem there is the use of system feasibility/resources more than the ability-to-function but that's still a pretty clever idea...

            Corey Milner
            Creative Director, Indigo Rose Software

            Comment


            • #7
              Here's an example. this uses not really much resourses 'cos it only make a single system time check on button click and anly that.
              Please check this out. and tell me if works as you wish
              Attached Files
              Last edited by ; 12-22-2004, 10:43 AM.

              Comment


              • #8
                Sorry, I made a mistake

                Sorry I post because I thougth It was a AMS 5 forum.
                But the idea could be easily taken.

                the script on the button
                Code:
                hour = System.GetTime(TIME_FMT_HOUR)
                minutes = System.GetTime(TIME_FMT_MIN)
                endTime = Input.GetText("Input1")
                everythingToSeconds(hour, minutes, endTime);
                the script on the globals
                Code:
                function everythingToSeconds(hh, mm, ee)
                	hh = hh * 3600;
                	mm = mm * 60;
                	endMinute = String.Right(ee, 2)
                	endHour = String.Left(ee, 2)
                	endHour = endHour * 3600;
                	endMinute = endMinute * 60;
                	
                	timer = ((endHour + endMinute) - (hh + mm)) * 1000;
                	Page.StartTimer(timer);--Starts the timer at the definied time
                end
                The page OnTimer event
                Code:
                Page.StopTimer()
                Application.Exit()
                you could add seconds for more accurate timer but this has a 59 secs as maximmun error taken, so I think it's ok

                someone can make a conversion please....
                Last edited by ; 12-22-2004, 10:48 AM.

                Comment

                Working...
                X