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

Re: [Clip] Re: Staus check of ^!SetDebug

Expand Messages
  • Larry Thomas
    Hi Hugo, ... Because he will not want the subclip to turn Debug on when it finishes after he has finished testing the main clip and removed the ^!SetDebug On
    Message 1 of 3 , Jul 1, 2003
    • 0 Attachment
      Hi Hugo,

      At 09:38 PM 7/1/03 -0000, you wrote:
      >
      >Mike (et al),
      >
      >Why don't you ^!SetDebug OFF at the beginning of the FARCLIP and
      >switch it back [^!SetDebug] ON at the end of it?
      >
      Because he will not want the subclip to turn Debug on when it finishes
      after he has finished testing the main clip and removed the ^!SetDebug On
      from it. If he had modified the Farclip then he would have to go back and
      remove the modifications.

      Mike, I have another idea though. You could modify the subclip as follows:

      At the beginning of the subclip place this code:

      ^!IfSame "^%BeginStatus%" "^%Empty% Skip Else Next
      ^!^%BeginStatus%

      At the end of the subclip place this code:

      ^!IfSame "^%EndStatus%" "^%Empty% End Else Next
      ^!^%EndStatus%


      When you insert the ^!SetDebug On code into the main clip that calls the
      subclip, also include the following code:

      ^!Set %BeginStatus%=SetDebug Off
      ^!Set %EndStatus%=SetDebug On

      Now you can fun the Farclip 10 times or 100 time or 1000 times and it will
      automatically turn of the Debug option everytime it is run and turn it back
      on when it returns to the main clip.

      Regards,

      Larry
      lrt@... e¿ê
    • mbl60181
      Thanks folks for all your suggestions. Looks like what I really need isn t in the current version... something like ^$IsDebugOn$. Maybe Eric will add it in V.5
      Message 2 of 3 , Jul 2, 2003
      • 0 Attachment
        Thanks folks for all your suggestions. Looks like what I really need
        isn't in the current version... something like ^$IsDebugOn$. Maybe
        Eric will add it in V.5

        Thanks again!
        -Mike LaFountain

        P.S.

        For your amusement... I present the ^!Farclip in question. It's
        really very simple. I got tired of writing endless loops to find the
        position of an array element. So I wrote this little routine
        to "LookUp" the position.

        ;L O O K U P

        ; This routine returns the position of the search argument
        ; in an array. The search is case sensitive.

        ; PARAMETERS IN:
        ; ^%LkupSource%= The data to find in an array (search argument)
        ; ^%LkupSearch%= The array to be search
        ; ^%LkupErrMsg%= If passed as "No", action is not taken if the
        search
        ; argument isn't found in the array.
        ; If passed as "Yes", an error message is issued and
        ; ^!SetDebug is turned on.
        ; ^%LkupStart%= Optional: Starting array element for array search.
        ; If zero or blank element 1 is used.
        ; PARAMETERS OUT:
        ; ^%LkupTarget%= The number of the array element where the search
        ; argument was found. Will be zero if not found.
        ; ^%LkupStart%= Parameter is set to null after each use.

        ;Pre-set parameters for testing (OK to remove)
        ;^!SetDebug On
        ;^!Set %LkupSource%=ABC
        ;^!SetArray %LkupSearch%=ABC;DEF;GHI;JKL;MNO;ABC;DEF;GHI;JKL;MNO
        ;^!Set %LkupErrMsg%=Yes
        ;^!Set %LkupStart%=7

        ;Execute routine
        ^!Set %LkupTarget%=0
        ^!Set %LkupX%=1
        ^!If ^%LkupStart%>0 ^!Set %LkupX%=^%LkupStart%
        ^!Set %ErrStart%=^%LkupX%
        ^!Set %LkupStart%=^%Empty%

        :LkupLoop
        ^!If ^%LkupSearch^%LkupX%%=^%LkupSource% Next Else Skip_2
        ^!Set %LkupTarget%=^%LkupX%
        ^!Goto End
        ^!Inc %LkupX%
        ^!If ^%LkupX%>^%LkupSearch0% Next Else LkupLoop

        ;Show error message
        ^!IfFalse ^%LkupErrMsg% End Else Next
        ^!Continue Search argument:^%NL%^%LkupSource%^%NL%not found in
        array:^%NL%^%LkupSearch%^%NL%Using start position: ^%ErrStart%^%NL%^%
        NL%Click OK to continue in debug mode.
        ^!SetDebug On
      • hsavage
        ... Mike, Here s one last suggestion to automate turning ^!SetDebug off and on when using a ^!FarClip frequently while debugging another script. I ve altered
        Message 3 of 3 , Jul 6, 2003
        • 0 Attachment
          mbl60181 wrote:

          > Thanks folks for all your suggestions. Looks like what I really need
          > isn't in the current version... something like ^$IsDebugOn$. Maybe
          > Eric will add it in V.5
          >
          > Thanks again!
          > -Mike LaFountain
          >
          > P.S.
          >
          > For your amusement... I present the ^!Farclip in question. It's
          > really very simple. I got tired of writing endless loops to find the
          > position of an array element. So I wrote this little routine
          > to "LookUp" the position.

          Mike,

          Here's one last suggestion to automate turning ^!SetDebug off and on
          when using a ^!FarClip frequently while debugging another script. I've
          altered your, abbreviated, clip below as an example. I prefer using 1
          and 0 for ON and OFF, saves typing.

          ----
          You can accomplish this by modifying your ^!FarClip as below. Add

          ^!SetDebug 0 or OFF

          immediately after the ^!FarClip clip title.
          ----
          Add

          ^!SetDebug ^%setdebug%
          or
          ^!IfTrue ^%setdebug% ^!SetDebug 1

          as the last line of the ^!FarClip
          ----
          These changes can be permanent, they have no effect unless ^!SetDebug is on.
          ------

          In the clip you're debugging you will, of course, already have
          ^!SetDebug on. Replace the ^!SetDebug ON line with the following 2 lines;

          ^!Set %setdebug%=1
          ^!SetDebug ^%setdebug%
          ------

          This still gives you a single point for turning ^!SetDebug on or off in
          the main clip just by changing the value of the ^%setdebug% variable
          from 1 to 0.

          hrs



          H="L O O K U P"
          ; --------- setdebug off, won't matter if it's already off
          ^!SetDebug 0
          ; --------- place anywhere before first command.
          ;
          ; This routine returns the position of the search argument
          ; in an array. The search is case sensitive.
          -
          -
          -
          ;Show error message
          ^!IfFalse ^%LkupErrMsg% End Else Next
          ^!Continue Search argument:^%NL%^%LkupSource%^%NL%not found in
          array:^%NL%^%LkupSearch%^%NL%Using start position:
          ^%ErrStart%^%NL%^%NL%Click OK to continue in debug mode.
          ;
          ; --------- place after the last clip line unless an EXIT
          ^!SetDebug ^%setdebug%
          or
          ^!IfTrue ^%setdebug% ^!SetDebug 1

          ; --------- or other command will cause it to miss the line.
        Your message has been successfully submitted and would be delivered to recipients shortly.