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

[Clip] replace selection - focus

Expand Messages
  • PatHanneman
    I ve a transition problem here. Previously in ntp 4.6, a clip acted differently if text were selected or not. no selection: the clip would search/replace the
    Message 1 of 4 , Mar 4, 2000
    • 0 Attachment
      I've a transition problem here.

      Previously in ntp 4.6, a clip acted differently if text were selected or not.

      no selection: the clip would search/replace the entire doc and reset the focus to the top of the doc

      with selection: the focus returned to the top of the selection block (not top of doc)

      now it always resets to the top of the doc. Anyone see why?

      ;Fractions to text
      ^!Replace ½ 1/2 CWHSA


      here are some fractions to play with-
      but this text would not start the document.


      Ingredients:
      1½ tablespoons olive oil, preferably extra virgin
      1 medium onion, chopped
      2 carrots, peeled and thinly sliced
      1 large celery rib, thinly sliced
      2 garlic cloves, finely chopped
      3 cups defatted lower-sodium chicken broth or vegetable broth
      1½ cups dried green or brown lentils, rinsed and picked over
      1 can (16 ounces) stewed tomatoes with juice
      1 bay leaf, broken in half
      ½ teaspoon salt, or to taste
      1½ teaspoons chopped fresh rosemary or 1 teaspoon dried
      1½ teaspoons chopped fresh sage or 1 teaspoon dried
      2 teaspoons balsamic vinegar
      Freshly ground black pepper and salt to taste
    • Jody
      Hi Pat, ... ^!Replace ½ 1/2 CTHSA The W option tells it to search the whole document so the H is basically ignored. I also added the T option so it
      Message 2 of 4 , Mar 5, 2000
      • 0 Attachment
        Hi Pat,

        > no selection: the clip would search/replace the entire doc and
        > reset the focus to the top of the doc
        >
        > with selection: the focus returned to the top of the selection
        > block (not top of doc)
        >
        > now it always resets to the top of the doc. Anyone see why?
        >
        > ;Fractions to text
        > ^!Replace ½ 1/2 CWHSA

        ^!Replace "½" >> "1/2" CTHSA

        The W option tells it to search the whole document so the H is
        basically ignored. I also added the T option so it would change
        it in say 1½ but you may not want that.

        Happy Clip'n!
        Jody

        http://www.sureword.com/notetab

        Subscribe, UnSubscribe, Options
        mailto:Ntb-Clips-Subscribe@...
        mailto:Ntb-Clips-UnSubscribe@...
        http://www.egroups.com/list/ntb-clips
      • PatHanneman
        Thanks, Jody. Seems I was wanting to do all three things - whole, cursor downward, selection - and that s just wrong! BTW - I ve noticed that NT isn t very
        Message 3 of 4 , Mar 6, 2000
        • 0 Attachment
          Thanks, Jody.
          Seems I was wanting to do all three things - whole, cursor downward, selection - and that's just wrong!

          BTW - I've noticed that NT isn't very finicky about those quotes in replace statement.

          Both of these work equally well. Are the quotes not really needed?


          ^!Replace ½ >> 1/2 CHSA
          ^!Replace "½" >> "1/2" CHSA


          BTW - in re:
          >>>The W option tells it to search the whole document so the H is
          basically ignored. I also added the T option so it would change
          it in say 1½ but you may not want that. <<<

          I do two replacement runs --
          C - whole-word first
          T - part of word second - so that I can insert the needed space " 1/2" and get 1 1/2

          And I do that for each of the fraction symbols that show up in cooking.
        • Jody
          Hi Pat, ... Actually it is fairly strict about the quotes although in some places they may be omitted. I like to follow the rule of thumb, if quotes may be
          Message 4 of 4 , Mar 6, 2000
          • 0 Attachment
            Hi Pat,

            > BTW - I've noticed that NT isn't very finicky about those
            > quotes in replace statement.
            >
            > ^!Replace ½ >> 1/2 CHSA
            > ^!Replace "½" >> "1/2" CHSA

            Actually it is fairly strict about the quotes although in some
            places they may be omitted. I like to follow the rule of thumb,
            if quotes may be used somewhere (and need to be at times), then
            always use them in that place whether needed or not.

            ^!Replace has two formats:

            Old:
            ^!Replace(space)find(tab)replace with(tab)options
            New:
            ^!Replace(space)"find"(space)>>(space)"replace with"(space)options

            I used the newest and you used the old. The quotes have to be
            used is there is more than one word in the search criteria in the
            latest format.

            > I do two replacement runs --
            > C - whole-word first
            > T - part of word second - so that I can insert the needed space
            > " 1/2" and get 1 1/2

            That will work of course, but if I remember correctly you did not
            have a space after the whole number before the fraction. In that
            case you need to add the T option keeping in mind that if you
            were converting back and say you had a date of 1/20/2000 in the
            searched text it too would be edited: ½0/2000.

            Happy Clip'n!
            Jody

            http://www.sureword.com/notetab

            Subscribe, UnSubscribe, Options
            mailto:Ntb-Clips-Subscribe@...
            mailto:Ntb-Clips-UnSubscribe@...
            http://www.egroups.com/list/ntb-clips
          Your message has been successfully submitted and would be delivered to recipients shortly.