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

Re: Staus check of ^!SetDebug

Expand Messages
  • 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 1 of 3 , Jul 2, 2003
      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 2 of 3 , Jul 6, 2003
        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.