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

Re: [Clip] How to replace text in a string with clipcode?

Expand Messages
  • Axel Berger
    ... There is an alphabetic list with one important snag: ^? , the details of which I always forget, is not in it and quite hard to find every time, meaning
    Message 1 of 12 , Aug 16, 2010
    • 0 Attachment
      Eb wrote:
      > On the other hand, the existing topics are roughly in the order
      > of importance for a beginner.

      There is an alphabetic list with one important snag: "^?", the details
      of which I always forget, is not in it and quite hard to find every
      time, meaning the /obvious place/ "variables" is not that obvious to me.

      But far more important to this thread, we seem to have lost Sherry,
      which is a shame. I still believe any solution that forces her to
      highlight each and every occurrence of the string manually is no help at
      all, but I do need more input to provide a solution that is.

      N.B: My clips tend to be rather primitive and brain dead on purpose,
      e.g. using several primitive lines when a single one would suffice. It
      not only makes them more easily legible for beginners but also for
      myself, when I need to remind myself, what that clip, written months
      ago, actually does. I admire diodeom's one-liners but for me at least,
      they are quite hard to understand.

      Sherry, if you're still with us: don't be put off by our internal digs
      between the "experts", we're really all trying to help.

      Axel
    • flo.gehrke
      ... Eb, For a better overview, Ray Fitzgerald created his ToolTips.CLB, last updated in Feb 2000. It s in the ClipClass+Clip Basics+more.ZIP file that Alec
      Message 2 of 12 , Aug 17, 2010
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "Eb" <ebbtidalflats@...> wrote:

        > > ^!Replace "_" >> "^%Space%" HATS
        > > ^!Toolbar Capitalize
        >
        > Instead of Toolbar, the Menu command would be better, because it
        > is much easier to find it's available options:
        >
        > ^!Replace "_" >> "^%Space%" HATS
        > ^!Menu Modify/"Text Case"/Capitalize

        Eb,

        For a better overview, Ray Fitzgerald created his ToolTips.CLB, last updated in Feb 2000. It's in the ClipClass+Clip Basics+more.ZIP file that Alec uploaded to the File section of this group in Dec 2008.

        I found it quite useful. Checking it against the latest ^!Toolbar options in NT 6.2, I found two issues:

        1. "Printer Settings" doesn't work in NT 6.2 and returns an error message. So you better delete it.

        2. There is a "Page Setup" option in NT 6.2 but not in that clipbook. One may add this option in order to see all valid options.

        Regards,
        Flo
      • Eb
        Thanks, Flo, I agree, and the most useful file, Toolbar.txt contains the descriptions missing from the NoteTab Help file. The clip library isn t bad either,
        Message 3 of 12 , Aug 20, 2010
        • 0 Attachment
          Thanks, Flo,

          I agree, and the most useful file, "Toolbar.txt" contains the descriptions missing from the NoteTab Help file.

          The clip library isn't bad either, though somewhat confusing.

          See the "Help with clips" post for a suggestion to clippers, how to avoid such confusion.



          Cheers,

          Eb


          --- In ntb-clips@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
          >
          > --- In ntb-clips@yahoogroups.com, "Eb" <ebbtidalflats@> wrote:
          >
          > > > ^!Replace "_" >> "^%Space%" HATS
          > > > ^!Toolbar Capitalize
          > >
          > > Instead of Toolbar, the Menu command would be better, because it
          > > is much easier to find it's available options:
          > >
          > > ^!Replace "_" >> "^%Space%" HATS
          > > ^!Menu Modify/"Text Case"/Capitalize
          >
          > Eb,
          >
          > For a better overview, Ray Fitzgerald created his ToolTips.CLB, last updated in Feb 2000. It's in the ClipClass+Clip Basics+more.ZIP file that Alec uploaded to the File section of this group in Dec 2008.
          >
          > I found it quite useful. Checking it against the latest ^!Toolbar options in NT 6.2, I found two issues:
          >
          > 1. "Printer Settings" doesn't work in NT 6.2 and returns an error message. So you better delete it.
          >
          > 2. There is a "Page Setup" option in NT 6.2 but not in that clipbook. One may add this option in order to see all valid options.
          >
          > Regards,
          > Flo
          >
        • Sherry
          Hello, Thank you so much, EVERYONE, for answering my request. I am sorry for not responding earlier. But I did read the discussion and finally today I am in
          Message 4 of 12 , Aug 22, 2010
          • 0 Attachment
            Hello,

            Thank you so much, EVERYONE, for answering my request. I am sorry for not responding earlier. But I did read the discussion and finally today I am in the need of the code.

            Again, I am sorry for not communicating earlier, requiring you to read my mind ;)

            I picked this code below, and, having inserted it into my HTML.clb library, it works like a charm. (Had to get admin privileges to add/modify the library). That is exactly what I wanted. Someday when I need more, I will study the code and modify if needed.

            I really appreciate the responsiveness of everyone in the group, you guys rock! There is something very satisfying to have a simple code do wonders with my text ;)

            Greetings, and have a great rest of the weekend!

            Sherry

            --- In ntb-clips@yahoogroups.com, hsavage <hsavage@...> wrote:
            >
            > Sherry wrote:
            > > It's funny, I have worked with NoteTab Pro for a month and still
            > can't find a tutorial for Clipcode! A simple Hello World type code
            > tutorial? I'd like some hints for that! Not just a pointer to a file
            > full of complicated clipcode. Maybe a short 5 min video tutorial with
            > a simplest of all examples? Just a suggestion.
            > >
            > > My question is: How do I write a clip code that will replace all
            > occurrences of _ with a space and then capitalize all words?
            > >
            > > for example
            > >
            > > "aa_bb_cc_dd_ee" should be replaced by "Aa Bb Cc Dd Ee"
            > >
            > > or maybe not replace in a string, but instead replace within a
            > highlighted piece of text.
            > >
            > > Replacement in place is fine.
            > >
            > > Thanks in advance! I feel clipcode is a really valuable concept
            > but extremely tough to crack into! For example, I am proficient with
            > Xemacs macros, and they are easy to define.... at least for me!
            > >
            > > Thanks again! Sherry
            >
            > Sherry,
            >
            > Reg-exp has been pretty well covered for your problem. Here's a
            > simple clip language method to resolve your request.
            >
            > It does nothing more or less than you asked with your example. I
            > hope you can copy and paste this into a library to use, if you don't
            > know how reply back to this clips list.
            >
            > ----------------------------------
            > H="Replace Underscore & Capitalize"
            > ;_WITHOUT REG-EXP
            > ;_
            > ^!If ^$GetSelSize$ = 0 NEXT ELSE SOMETHING_SELECTED
            > :NOTHING_SELECTED
            > ;_With nothing selected this 3 line group executes whole document
            > ^!Replace "_" >> " " TWSA
            > ^!Select ALL
            > ^!GoTo END
            > ;_
            > :SOMETHING_SELECTED
            > ^!If ^$GetSelSize$ > 0 NEXT ELSE END
            > ;_With selection made these last 2 lines execute on selected text
            > ^!Replace "_" >> " " THSA
            > :END
            > ^$StrCapitalize("^$GetSelection$")$
            > ------------------------------------
            >
            > ·············································
            > ºvº SL_day# 226 - created 2010.08.14_17.15.01
            >
            > Party Etiquette; Drinking Your Fair Share.
            >
            > € hrs € hsavage € pobox € com
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.