Loading ...
Sorry, an error occurred while loading the content.

13390Re: timing clip execution

Expand Messages
  • giannis_rho
    Mar 1, 2005
      --- In ntb-clips@yahoogroups.com, "thefrank" <tf@t...> wrote:
      > I want to have a parent clip run a child clip for 20 seconds then
      > stop the child clip and continue with the next instruction from the
      > parent clip.

      Maybe this can help you.

      ^!SetListDelimiter :
      ;Example for 1 min and 30 secs
      ^!SetArray %timer%=^?{Execute clip for Hours:Minutes:Secs
      ; Starting time
      ^!SetArray %StartTime%=^$GetDate(h)$:^$GetDate(n)$:^$GetDate(s)$
      ^!Goto start
      ^!StatusShow You execute the clip for ^%hours%:^%minutes%:^%seconds%
      ^!Delay 20
      ^!Goto end

      ; Starting time again
      ^!Set %hour_start%=^%StartTime1%; %min_start%=^%StartTime2%;
      ; Time now
      ^!Set %hour_end%=^$GetDate(h)$; %min_end%=^$GetDate(n)$;
      ;Calc Seconds
      ^!If ^%sec_end% >= ^%sec_start% skip
      ^!Set %sec_end%=^$Calc(^%sec_end%+60)$; %min_end%=^$Calc(^%min_end%-1)$
      ^!Set %seconds%=^$Calc(^%sec_end%-^%sec_start%)$
      ;Calc Minutes
      ^!If ^%min_end% >= ^%min_start% skip
      ^!Set %min_end%=^$Calc(^%min_end%+60)$; %hour_end%=^$Calc(^%hour_end%-1)$
      ^!Set %minutes%=^$Calc(^%min_end%-^%min_start%)$
      ;Calc Hours
      ^!If ^%hour_end% >= ^%hour_start% skip
      ^!Set %hour_end%=^$Calc(24+^%hour_end%)$
      ^!Set %hours%=^$Calc(^%hour_end%-^%hour_start%)$
      ;Checks passed time
      ^!If ^%hours%^%minutes%^%seconds% >= ^%timer1%^%timer2%^%timer3% back
      ;Do anything you want ...
      ^!StatusShow Time ^%hours%:^%minutes%:^%seconds% / ^%timer%
      ^!Delay 10
      ; ... and go to start
      ^!Goto start
    • Show all 9 messages in this topic