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

Find/Rep diff in Pro and Light?

Expand Messages
  • Stephen Gilbert
    Hi, I m writing clips in Pro 4.9, and some of my clips aren t working the same way for my users in Light 4.9. Is this normal? I m finding this particularly
    Message 1 of 3 , Mar 31, 2003
      Hi,

      I'm writing clips in Pro 4.9, and some of my clips aren't working the same way for my users in Light 4.9. Is this normal?

      I'm finding this particularly with some Find and Replace commands.

      XML Example below. The clip's goal is to locate any <Supp>...</Supp> tags and change them to a new type of tag per user's choice. In Pro it works fine, but in Light it changes only the closing </Supp>.

      Ideas?

      Stephen

      ====Test code
      <Supp>Hi there.</Supp>
      ==========

      H="Supp search replace"
      ^!Jump DOC_START
      :begin
      ^!Set %success%=^$SelectTagInclusive(Supp)$
      ^!If ^%success% < 1 Exit
      ^!Info ^$GetSelection$
      ^!Set %xmlcode%=^?{(1;T=W)The Supp in the following code needs to be replaced:=^$GetSelection$}; %tag%=^?{(2)Replace with:=case|example|exercise|info|_note|selfassessment|tip|video}
      ^!REPLACE "<Supp>" >> "<^%tag%>" CHSI
      ^!REPLACE "</Supp>" >> "</^%tag%>" CHSI
      ^!Goto begin

      ======
      H="SelectTagInclusive"
      ;This Clip will select all the text enclosed in the type of tag specified by the user, including the tag.

      ;Search forwards for the opening tag
      ^!Find "<^&" CIS
      ;End procedure if the searched tag is not found
      ^!IfError ^!Goto finish
      ;Ensure input focus is in the document
      ^!FocusDoc
      ;Place cursor at start of selection and remove highlight
      ^!Jump Select_Start
      ;Store cursor position in a variable
      ^!Set %Start%=^$GetRow$:^$GetCol$
      ;Search for the closing tag
      ^!Find "</^&>" CIS
      ;End the procedure if it is not found
      ^!IfError ^!Goto finish
      ;Place cursor at end of selection and remove highlight
      ^!Jump Select_End
      ;Store cursor position in a variable
      ^!Set %End%=^$GetRow$:^$GetCol$
      ;Move the cursor back to the first saved position (after the opening tag)
      ^!SetCursor ^%Start%
      ;Extend the selection to the second saved position (in front of the closing tag)
      ^!SelectTo ^%End%
      ^!Result 1
      ^!Goto End
      :finish
      ^!Result 0
    • Sheri
      ... Hello, It is necessary to test clips under both platforms to make sure they are compatible because a few differences in clip behavior have come up before.
      Message 2 of 3 , Mar 31, 2003
        At 03:23 PM 3/31/03 -0600, Stephen wrote:
        >Hi,
        >
        >I'm writing clips in Pro 4.9, and some of my clips aren't working the same way for my users in Light 4.9. Is this normal?
        >
        >I'm finding this particularly with some Find and Replace commands.
        >
        >XML Example below. The clip's goal is to locate any <Supp>...</Supp> tags and change them to a new type of tag per user's choice. In Pro it works fine, but in Light it changes only the closing </Supp>.
        >
        >Ideas?
        >
        >Stephen

        Hello,

        It is necessary to test clips under both platforms to make sure they are compatible because a few differences in clip behavior have come up before. I tried your clips on Pro and Light 4.92 (you should update if you are really on 4.9) and saw the difference.

        The differences I've see before related to ^$GetLine$ and ^!Select Line.

        Your clips show a difference in what constitutes a whole word to the ^!Replace command, as filtered by the "C" option. For some reason, Pro sees <Supp> as a whole word and Light doesn't. But it hardly seems relevant to what you are doing, and your clips work on fin on both Pro and Light if you remove the "C" 's from your ^!Replace commands.

        Nice clips!

        Regards,
        Sheri
      • Stephen Gilbert
        Thank you! That helped me with another clip, too.
        Message 3 of 3 , Apr 1, 2003
          Thank you! That helped me with another clip, too.

          Sheri wrote:

          > At 03:23 PM 3/31/03 -0600, Stephen wrote:
          > >Hi,
          > >
          > >I'm writing clips in Pro 4.9, and some of my clips aren't working the same way for my users in Light 4.9. Is this normal?
          > >
          > >I'm finding this particularly with some Find and Replace commands.
          > >
          > >XML Example below. The clip's goal is to locate any <Supp>...</Supp> tags and change them to a new type of tag per user's choice. In Pro it works fine, but in Light it changes only the closing </Supp>.
          > >
          > >Ideas?
          > >
          > >Stephen
          >
          > Hello,
          >
          > It is necessary to test clips under both platforms to make sure they are compatible because a few differences in clip behavior have come up before. I tried your clips on Pro and Light 4.92 (you should update if you are really on 4.9) and saw the difference.
          >
          > The differences I've see before related to ^$GetLine$ and ^!Select Line.
          >
          > Your clips show a difference in what constitutes a whole word to the ^!Replace command, as filtered by the "C" option. For some reason, Pro sees <Supp> as a whole word and Light doesn't. But it hardly seems relevant to what you are doing, and your clips work on fin on both Pro and Light if you remove the "C" 's from your ^!Replace commands.
          >
          > Nice clips!
          >
          > Regards,
          > Sheri
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.