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

Re: [Clip] The operation of ^%NL%

Expand Messages
  • Larry Thomas
    ... Hi Roy, This clip removes all blanks from your document(s) including any blanks that may be at the end of the document. It addresses a number of problems
    Message 1 of 4 , Oct 5, 2003
    • 0 Attachment
      At 04:01 PM 10/2/03 -0600, you wrote:
      >I have a question on the operation of ^%NL%.
      >I have a simple clip below that deletes blank lines.
      >It works fine, but if a line contains an equal sign (=), it thinks
      >it is a null line and deletes it.
      >Can anyone help?
      >Thanks, Roy

      Hi Roy,

      This clip removes all blanks from your document(s) including any blanks
      that may be at the end of the document. It addresses a number of problems
      in the clip you previously posted. Your clip does not work if any lines
      are wrapped to the screen. Also, your clip fails to take into account the
      fact that the total line count for the document decreases everytime a line
      is deleted. The result is that the clip will try to run past the end of
      the document. In addition to that, your clip will only process every other
      line because it moves the cursor even when a line is deleted. You do not
      want to do this because deleting a line moves all of the other lines up in
      the document so that the current line is now the one you want to process
      but your clip jumps to the next line without processing it.

      Here is my replacement clip:

      ______[Copy below this line]_______
      H="Remove Blank Lines"
      ;lrt@... e¿ê
      ;10/05/2003, 03:58:17 PM
      ^!Set %Wordwrap%=^$IsWordWrap$
      ^!SetWordwrap 0
      ^!Jump 1
      :Loop
      ^!If ^$GetLineSize$ > 0 Skip_2 ELSE Next
      ^!DeleteLine
      ^!If ^$GetRow$ = ^$GetTextLineCount$ Skip ELSE Loop
      ^!Jump +1
      ^!If ^$GetLineSize$ > 0 Skip ELSE Next
      ^!DeleteLine
      ^!If ^$GetRow$ >= ^$GetTextLineCount$ Next ELSE Loop
      ^!SetWordwrap ^%Wordwrap%
      ^!Keyboard Ctrl+End
      ^!If ^$GetLineSize$ > 0 Exit ELSE Next
      ^!Keyboard Ctrl+End Backspace
      _____[Copy above this line]______
      | right click over the clipbook |
      | and choose "Add from Clipboard" |
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      Regards,

      Larry
      lrt@... e¿ê
    • Larry Thomas
      ... Hi Roy, I just received your post to me about wanting to delete lines that appear blank but contain non-printing characters such as spaces, tabs,etc as
      Message 2 of 4 , Oct 5, 2003
      • 0 Attachment
        At 04:01 PM 10/2/03 -0600, you wrote:
        >I have a question on the operation of ^%NL%.
        >I have a simple clip below that deletes blank lines.
        >It works fine, but if a line contains an equal sign (=), it thinks
        >it is a null line and deletes it.
        >Can anyone help?
        >Thanks, Roy

        Hi Roy,

        I just received your post to me about wanting to delete lines that appear
        blank but contain non-printing characters such as spaces, tabs,etc as well
        a the newline character pair. I have revised my clip and I believe that
        this will work for you.

        Here it is.

        ______[Copy below this line]_______
        H="Remove Blank Lines"
        ;lrt@... e¿ê
        ;10/05/2003, 04:32:24 PM
        ^!Set %Wordwrap%=^$IsWordWrap$
        ^!SetWordwrap 0
        ^!Jump 1
        :Loop
        ^!IfTrue ^$Isblank(^$Getline$)$ Skip ELSE Next
        ^!If ^$GetLineSize$ > 0 Skip_2 ELSE Next
        ^!DeleteLine
        ^!If ^$GetRow$ = ^$GetTextLineCount$ Skip ELSE Loop
        ^!Jump +1
        ^!IfTrue ^$Isblank(^$Getline$)$ Skip ELSE Next
        ^!If ^$GetLineSize$ > 0 Skip ELSE Next
        ^!DeleteLine
        ^!If ^$GetRow$ >= ^$GetTextLineCount$ Next ELSE Loop
        ^!SetWordwrap ^%Wordwrap%
        ^!Keyboard Ctrl+End
        ^!IfTrue ^$Isblank(^$Getline$)$ Next ELSE Skip
        ^!DeleteLine
        ^!If ^$GetLineSize$ > 0 Exit ELSE Next
        ^!Keyboard Ctrl+End Backspace
        _____[Copy above this line]______
        | right click over the clipbook |
        | and choose "Add from Clipboard" |
        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

        Regards,

        Larry
        lrt@... e¿ê
      Your message has been successfully submitted and would be delivered to recipients shortly.