Menu

Delete Line Question

Mike Stone
2007-06-12
2012-11-14
  • Mike Stone

    Mike Stone - 2007-06-12

    Good Day all

      I need to scan the document and remove an entire line if it contains (Conintue) and also the line underder it.

      What is the best way to do this? 

     
    • Nobody/Anonymous

      use this to remove the line content

      void replaceCurrentLine(string replacement)
      {
          unsigned int curPosition = SendMessage(getCurScintilla(), SCI_GETCURRENTPOS, (WPARAM)0, (LPARAM)0);
          unsigned int curLineNum = SendMessage(getCurScintilla(), SCI_LINEFROMPOSITION, (WPARAM)curPosition, (LPARAM)0);
         
          unsigned int startPos = SendMessage(getCurScintilla(), SCI_POSITIONFROMLINE, (WPARAM)curLineNum, (LPARAM)0);
          unsigned int endPos = SendMessage(getCurScintilla(), SCI_GETLINEENDPOSITION, (WPARAM)curLineNum, (LPARAM)0);
         
          SendMessage(getCurScintilla(), SCI_SETSEL, (WPARAM)startPos, (LPARAM)endPos);
          SendMessage(getCurScintilla(), SCI_REPLACESEL, (WPARAM)0, (LPARAM)replacement.c_str());
      }

       
    • Nobody/Anonymous

      i also need this: a function to delete the line if xyz is within the line.