actually it is not the replacerx line at all that is removing the line
it is this line
if ss.len
because the line len value is 0
I will recode this as there are a lot more issues that haven't come up yet that need to be fixed.
will post in a few minutes.
sorry for the delay got a phone call.
this covers a lot more but still doesn't cover everything.
forgot to paste this function as well
needs this to show result in qm format
Function ShowText3
if dont want comment out this line in above function
and replace with
it is this line
if ss.len
because the line len value is 0
I will recode this as there are a lot more issues that haven't come up yet that need to be fixed.
will post in a few minutes.
sorry for the delay got a phone call.
this covers a lot more but still doesn't cover everything.
out
opt clip 1
_s.getsel
if _s.len
,str s ss result
,int i j fn length1 length2
,ARRAY(str) labels a b
,a=_s
,if(findrx(_s "goto(\s.+)" 0 4 b 1)>0)
,,for i 0 b.len
,,,ss.formata("%s[]" b[0 i].rtrim)
,,ss.rtrim
,,labels=ss
,,ss.fix(0)
,if(findrx(_s "(?s) BEGIN DIALOG(.+?)''*'' '''' '''' ''''" 0 1 s)<>-1)
,,foreach ss s
,,,labels[]=ss
,for(i a.len-1 -1 -1)
,,for(j 0 labels.len)
,,,if(a[i] = labels[j])
,,,,fn=1
,,,,j=labels.len
,,,else
,,,,fn=0
,,if fn<>1
,,,length1=a[i].len
,,,a[i].replacerx("^\040.+|\040\;\;.+|\011\040.+")
,,,length2=a[i].len
,,,if(length1!=0 and length2= 0)
,,,,a.remove(i)
,result=a
,result.rtrim;;remove extra emptyline at end of result that array adds on
,result.replacerx("(?:(?:(?!\n)\s)*\n){2,}" "[][]");;replace multiple blank lines to 1
,ShowText3 "Results" result 0 2;;show the result in qm format
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
forgot to paste this function as well
needs this to show result in qm format
Function ShowText3
;/
function# $caption $text [hwndowner] [flags]
;Everything is the same as with <tip "#ShowText">ShowText</tip>, except:
;;;flag 1 (nonmodal) unavailable.
opt waitmsg 1
int i he=id(3 ShowText(caption text hwndowner flags|1))
CHARFORMAT cf.cbSize=sizeof(CHARFORMAT)
cf.dwMask=CFM_FACE|CFM_SIZE
strncpy(&cf.szFaceName "Courier New" 12)
long twips= 12*20
cf.yHeight=twips ;;twips
SendMessage he EM_SETCHARFORMAT SCF_ALL &cf
rep
,0.01
,if(!IsWindow(he)) break
ret
if dont want comment out this line in above function
and replace with