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?
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()); }
i also need this: a function to delete the line if xyz is within the line.
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?
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());
}
i also need this: a function to delete the line if xyz is within the line.