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

Re: [NTB] How to do this in a clip

Expand Messages
  • brandon@devgateway.com
    hi, OK, I ve spent a few hours figuring this out. I think I finally have something. This is what I m using right now for the long description part: ^!Set
    Message 1 of 4 , Feb 5, 2006
    • 0 Attachment
      hi,

      OK, I've spent a few hours figuring this out. I think I finally have something.

      This is what I'm using right now for the long description part:

      ^!Set %text%=^?{(T=W)long description}
      ^!Set %indentation%="^P"
      ^!Append %indentation%=^$StrFill(^$RemoveTokens("^T")$;^?[indentation])$
      ^!Append %indentation%=" * "
      ^$StrInsert(^$StrFill(^$RemoveTokens("^T")$;^?[indentation])$;^$StrInsert(" * ";^$StrReplace("^P";^%indentation%;^$StrSplit(^%text%;^$Calc(77 - (^?[indentation]) * 4;0)$;True)$;False;False)$;1)$;1)$

      If there's any simpler of a method, please point it out if possible; but this is the best I could find. :)

      Thanks,
      Brandon

      ----- Original Message -----
      From: <brandon@...>
      To: <notetab@yahoogroups.com>
      Sent: Sunday, February 05, 2006 2:48 AM
      Subject: [NTB] How to do this in a clip


      > hi,
      >
      > I'd like to make a clip to help me automatically create comments for my PHP classes.
      >
      > They are generally in this format:
      >
      > /**
      > * Class name
      > *
      > * Short description
      > *
      > * Long description,
      > * often on multiple lines
      > *
      > * @author Dev Gateway <development@...
      > * @version v1.0, last update on 2/4/2006 12:17:27
      > * @package packagename.subpackage
      > */
      >
      > I need a way to create that long description. It should be a multiline field, so the comment can be entered on a few lines.
      >
      > However, if a line of text is longer than 80 characters in length, it should be split onto a second line at the closest word boundary within that 80 character limit.
      >
      > So this line:
      >
      > this is a very very very very very long line, which contains more than 80 characters, and should be split onto a second line
      >
      > should be turned to:
      >
      > this is a very very very very very long line, which contains more than 80
      > characters, and should be split onto a second line
      >
      > The space between 80 and characters should be deleted, and a linebreak inserted.
      >
      > Further, every line, including blank lines, should have a space, and then an asterisk (*), plus another space, inserted.
      >
      > so:
      >
      > This is the first line describing the class
      >
      > This is another line
      >
      > Should be turned to
      >
      > *
      > This is the first line describing the class
      > *
      > * This is another line
      >
      > This should also happen for the text wrapped to a second line as described above.
      >
      > * this is a very very very very very long line, which contains more than 80
      > * characters, and should be split onto a second line
      >
      > Is this possible? I thought I had something like this working before, but not perfectly, and it took a lot of time to figure it out, and now I've lost it. Does anyone here know a way to do this?
      >
      > Thanks,
      > Brandon
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > The NoteTab Clips List: http://groups.yahoo.com/group/ntb-clips/
      > The NoteTab Off Topic List: http://groups.yahoo.com/group/ntb-offtopic/
      > Fookes Software: http://www.fookes.us, http://www.fookes.com
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
    • Don Daugherty
      I see you haven t gotten any replies yet. That s probably due to the fact that this list is a Basic list for elementary things. I d recommend resubmitting to
      Message 2 of 4 , Feb 6, 2006
      • 0 Attachment
        I see you haven't gotten any replies yet. That's probably due to the
        fact that this list is a
        Basic list for elementary things. I'd recommend resubmitting to the
        Clips list, where you're likely to find plenty of experienced help.
        (See end of this message for Clips list sign-up info.)
      • brandon@devgateway.com
        hi, Thanks for that, I will sign up there. I did figure it out though, so I m glad of that. :) Brandon ... From: Don Daugherty To:
        Message 3 of 4 , Feb 6, 2006
        • 0 Attachment
          hi,

          Thanks for that, I will sign up there. I did figure it out though, so I'm glad of that. :)

          Brandon

          ----- Original Message -----
          From: "Don Daugherty" <ddaugherty@...>
          To: <notetab@yahoogroups.com>
          Sent: Monday, February 06, 2006 10:19 AM
          Subject: Re: [NTB] How to do this in a clip


          >I see you haven't gotten any replies yet. That's probably due to the
          > fact that this list is a
          > Basic list for elementary things. I'd recommend resubmitting to the
          > Clips list, where you're likely to find plenty of experienced help.
          > (See end of this message for Clips list sign-up info.)
          >
          >
          > The NoteTab Clips List: http://groups.yahoo.com/group/ntb-clips/
          > The NoteTab Off Topic List: http://groups.yahoo.com/group/ntb-offtopic/
          > Fookes Software: http://www.fookes.us, http://www.fookes.com
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
          >
        • Stefan Elssner
          Hi Brandon, ... but this is the best I could find. :) If you not _insist_ on doing it with a clip, here is a simpler method: 1. Write your comment as you like,
          Message 4 of 4 , Feb 6, 2006
          • 0 Attachment
            Hi Brandon,

            >
            > If there's any simpler of a method, please point it out if possible;
            but this is the best I could find. :)

            If you not _insist_ on doing it with a clip, here is a simpler method:

            1. Write your comment as you like, dont care about the asteriks or
            anything

            2. Select the comment lines you wrote

            3. Use menu: Modify/Lines/Reformat Lines (shift+ctrl+m) and give 76
            for the text width (0 for the left margin)

            4. (Your reformatted lines should still be selected, else reselect
            them) Use menu: Search/Replace (ctrl+r), check Regular Expression, put
            a single '^' in the upper (reg. exp) box, and ' * ' in the lower
            (replace with) box, and go Replace all.

            5. You should have a proper long description part now...

            If you like you could still do the rest of the class comment from a
            script first, just let it put the cursor on the place where you want
            to start your long desc via ^& placeholder. Then type from there.

            Stefan
            --
            elssner@...
          Your message has been successfully submitted and would be delivered to recipients shortly.