01-27-2021, 01:44 AM
@kevin thanks a lot
The following comments are not deleted
Line 23
Line 35
Line 51 58
In addition, how to merge multiple blank lines into one blank line
For example:
Line 36-39
Line 44-45
Line 47-49
Macro Macro3
The following comments are not deleted
Line 23
Line 35
Line 51 58
In addition, how to merge multiple blank lines into one blank line
For example:
Line 36-39
Line 44-45
Line 47-49
Macro Macro3
out
_s.getsel
str s ss
int i
ARRAY(str) result
if _s.len
,findrx(_s "goto(\s.+)" 0 8 s 1); s.rtrim()
,foreach ss _s
,,if(StrCompareEx(ss s 1)<>0)
,,,ss.replacerx("^\040.+$|\040\;\;.+" "")
,,if ss.len
,,,result[]=ss
,mes result
else
,mes "nothing is selected"
#ret
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,QmRegisterDropTarget(id(3 hDlg) hDlg 0)
,__Font-- f.Create("Courier New" 8 0) ;;comment
,;__Font-- f.Create("Consolas" 8 0) ;;comment
,f.SetDialogFont(hDlg "3")
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_QM_DRAGDROP
,QMDRAGDROPINFO& di=+lParam
,sel wParam
,,case 3 ;;drop
,,str s
,,if(!di.GetText(s 1)) s=di.files
,,s.setsel(0 di.hwndTarget)
,,ret DT_Ret(hDlg 1)
,,;ret DT_Ret(hDlg 1) ;;comment
,,
,,
ret
;messages2
sel wParam
,case IDOK
,
,
,case IDCANCEL
,
,
,
ret 1
;sel wParam
,;case IDOK
,;int hcb3=id(3 hDlg)
,;int cp=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0) ;;currentpos: begin of the line
,;out cp
,;case IDCANCEL
;ret 1