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

Re: [Clip] timing clip execution

Expand Messages
  • Alan C
    Hi thefrank, How about: (untested, just an idea) at beginning of child clip start a timer. then from within same child clip: test (if, ifsame, etc.)
    Message 1 of 9 , Feb 19, 2005
    • 0 Attachment
      Hi thefrank,

      How about:

      (untested, just an idea)
      at beginning of child clip start a timer. then from within same child
      clip: test (if, ifsame, etc.) frequently for example

      if timer_value = 200 end

      when goto end in a child clip, terminates the child clip which returns
      to the next line of processing in the parent clip

      delay command also came to mind but might not be applicable to this
      situation.

      Another way: use the seconds filter of the date command and then to test
      for 20 seconds expiration either use:

      dec 20 (decrement 20) or use the calc function

      when such test returns true is a match (=>) (equal to or greater than 20
      seconds) then send it to the end label.

      There might be but I doubt it, a way to control this from the parent
      clip it's because when a child clip is running the powers of control is
      also delegated to such child clip.

      Alan.

      thefrank wrote:

      >Hello All,
      >
      >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.
      >
      >Cannot come up with a method.
      >
      >^!TimerStart seems to restart clip after an interval but not stop it.
      >^!TimerStop seems to only stop the clip from restarting.
      >
      >Seems like I am looking for something that would do:
      >
      >^!TimerPlay ClipName nnnn
      >
    • Alan C
      Alan C wrote: [ traffic direction/routing/control ] ... That is uncofirmed. It is just something that I have thought. Apologies. Sorry for mixup on what I
      Message 2 of 9 , Feb 19, 2005
      • 0 Attachment
        Alan C wrote:

        [ traffic direction/routing/control ]

        >There might be but I doubt it, a way to control this from the parent
        >clip it's because when a child clip is running the powers of control is
        >also delegated to such child clip.
        >
        That is uncofirmed. It is just something that I have thought.
        Apologies. Sorry for mixup on what I know versus something
        unconfirmed. I get to make a mistake and know too much but only very
        rarely such mistake.

        Alan.
      • thefrank
        Hello All, 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.
        Message 3 of 9 , Feb 19, 2005
        • 0 Attachment
          Hello All,

          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.

          Cannot come up with a method.

          ^!TimerStart seems to restart clip after an interval but not stop it.
          ^!TimerStop seems to only stop the clip from restarting.

          Seems like I am looking for something that would do:

          ^!TimerPlay ClipName nnnn

          Any ideas?

          regards,

          tf
          http://www.thefrank.com
        • Jody
          Hi thefrank, Offline now, and will forget this is in my outbox; sorry if already answered. ^!Delay nnn Adds a delay in 10th seconds before next instruction is
          Message 4 of 9 , Feb 19, 2005
          • 0 Attachment
            Hi thefrank,

            Offline now, and will forget this is in my outbox; sorry if already answered.

            ^!Delay nnn
            Adds a delay in 10th seconds before next instruction is executed. nnn is the time value.

            You can do the math, ;)

            >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.
            >
            >Cannot come up with a method.
            >
            >^!TimerStart seems to restart clip after an interval but not stop it.
            >^!TimerStop seems to only stop the clip from restarting.
            >
            >Seems like I am looking for something that would do:
            >
            >^!TimerPlay ClipName nnnn


            Happy Clip'n!
            Jody
            All Lists: http://www.fookes.us/maillist.htm
            Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
            UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
            Options: http://groups.yahoo.com/group/ntb-clips
            http://www.clean-funnies.com, http://www.sojourner.us/software

            [Non-text portions of this message have been removed]
          • thefrank
            yes I tried the ^!delay function but got what Alan referred to: using delay in the parent clip does not seem to affect the child clip while it is running. I
            Message 5 of 9 , Feb 19, 2005
            • 0 Attachment
              yes I tried the ^!delay function but got what Alan referred to: using
              delay in the parent clip does not seem to affect the child clip while
              it is running. I have tried calc routines.

              the hangup seems to be in the child clip here:

              ^!Set %PartUrl%=^$GetDosOutput("graburl.exe ^%Url%")$

              the var ^%Url% is passed from the parent clip. in the child clip
              graburl.exe usually returns a result just fine and everything
              proceeds as expected. but sometimes, maybe one out of 30, the clip
              just hangs while the status bar shows *reading dos output*. then I
              must manually stop the clip and reset to go again. therefore I was
              thinking to somehow run the child clip for only n seconds thus
              interrupting graburl.exe when it hangs and then proceeding to the
              next ^%Url% from the parent clip.

              thanks and regards,

              tf
              http://www.thefrank.com
            • Jody
              Hi thefrank, ... Does the Clip stop running here waiting for the output? I think so... If so, good luck, I m out of ideas. If not, ^!Delay 30 ... ^!Delay
              Message 6 of 9 , Feb 19, 2005
              • 0 Attachment
                Hi thefrank,

                >yes I tried the ^!delay function but got what Alan referred to: using
                >delay in the parent clip does not seem to affect the child clip while
                >it is running. I have tried calc routines.
                >
                >the hangup seems to be in the child clip here:
                >
                >^!Set %PartUrl%=^$GetDosOutput("graburl.exe ^%Url%")$

                Does the Clip stop running here waiting for the output? I think so...
                If so, good luck, I'm out of ideas. <g>

                If not,

                ^!Delay 30
                ; Delay enough to make sure Titlebar reads reading dos output:

                :Loop
                ^!Delay 10
                ^!IfDiff "^$GetAppTitle$" "reading dos output" Next else Skip_-1

                Might be case sensitive, but I don't think so. I think only ^!If
                without quotes around the parameters is the case sensitive one.

                (Hey, I turned the BIG 50 last month. I'm suppose to start
                forgetting this stuff. <g>)

                >the var ^%Url% is passed from the parent clip. in the child clip
                >graburl.exe usually returns a result just fine and everything
                >proceeds as expected. but sometimes, maybe one out of 30, the
                >clip just hangs while the status bar shows *reading dos output*.
                >then I must manually stop the clip and reset to go again.
                >therefore I was thinking to somehow run the child clip for only n
                >seconds thus interrupting graburl.exe when it hangs and then
                >proceeding to the next ^%Url% from the parent clip.


                Happy Clip'n!
                Jody

                All Lists: http://www.fookes.us/maillist.htm
                Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
                UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
                Options: http://groups.yahoo.com/group/ntb-clips
                http://www.clean-funnies.com, http://www.sojourner.us/software
              • abairheart
                ... using ... while ... Are you per chance using a ^!Wait statement after GetDosOutput? If yes, then NoteTab will wait for the DO comand to finish. You cannot
                Message 7 of 9 , Feb 22, 2005
                • 0 Attachment
                  --- In ntb-clips@yahoogroups.com, "thefrank" <tf@t...> wrote:
                  >
                  > yes I tried the ^!delay function but got what Alan referred to:
                  using
                  > delay in the parent clip does not seem to affect the child clip
                  while
                  > it is running. I have tried calc routines.
                  >
                  > the hangup seems to be in the child clip here:
                  >
                  > ^!Set %PartUrl%=^$GetDosOutput("graburl.exe ^%Url%")$
                  >

                  Are you per chance using a ^!Wait statement after GetDosOutput?

                  If yes, then NoteTab will wait for the DO comand to finish.
                  You cannot affect the time it takes DOS to complete. It will take
                  however long it takes.

                  If not, you may want to post the entire clipcode between the
                  subroutine call and the return from it.

                  Abair
                • Alan C
                  ... Some months ago, I had tinkered with the Perl LWP module http://search.cpan.org/search?query=LWP&mode=all I used it as a substitute (instead of graburl)
                  Message 8 of 9 , Feb 24, 2005
                  • 0 Attachment
                    thefrank wrote:

                    >Hello All,
                    >
                    >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.
                    >
                    >Cannot come up with a method.
                    >
                    Some months ago, I had tinkered with the Perl LWP module

                    http://search.cpan.org/search?query=LWP&mode=all

                    I used it as a substitute (instead of graburl) worked fine for that. I
                    likely could find some or all of my scripts which made that go using all
                    Notetab and Perl instead of Notetab and GrabUrl. If interested, I'd
                    willing to share them, not here on ntb-clips but over on the ntb-scripts
                    list.

                    But I did not do what you seek to do which is to kill a child process if
                    the child runs for longer than 20 seconds.

                    What I'm wondering is if the Perl

                    fork

                    forks off another process which could then be monitored (from the runing
                    Perl script) and killed if necessary (multi threading, Perl has this
                    capability at least on Linux -- I guess it would also have it on Windows).

                    Alan.
                  • giannis_rho
                    ... Maybe this can help you. ... ^!SetListDelimiter : ;Example for 1 min and 30 secs ^!SetArray %timer%=^?{Execute clip for Hours:Minutes:Secs
                    Message 9 of 9 , Mar 1, 2005
                    • 0 Attachment
                      --- 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.

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

                      :start
                      ; Starting time again
                      ^!Set %hour_start%=^%StartTime1%; %min_start%=^%StartTime2%;
                      %sec_start%=^%StartTime3%
                      ; Time now
                      ^!Set %hour_end%=^$GetDate(h)$; %min_end%=^$GetDate(n)$;
                      %sec_end%=^$GetDate(s)$
                      ;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
                      -----------------------------
                    Your message has been successfully submitted and would be delivered to recipients shortly.