Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Match comments
#9
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.
 
Code:
Copy      Help
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
Code:
Copy      Help
;/
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
Code:
Copy      Help
ShowText3 "Results" result 0 2;;show the result in qm format

and replace with
Code:
Copy      Help
mes result "Results"


Messages In This Thread
Match comments - by macman - 01-26-2021, 03:25 AM
RE: Match comments - by redbull2k - 01-26-2021, 12:46 PM
RE: Match comments - by macman - 01-26-2021, 11:41 PM
RE: Match comments - by Kevin - 01-26-2021, 11:54 PM
RE: Match comments - by macman - 01-27-2021, 01:44 AM
RE: Match comments - by Kevin - 01-27-2021, 02:16 AM
RE: Match comments - by macman - 01-27-2021, 03:03 AM
RE: Match comments - by macman - 01-29-2021, 12:50 AM
RE: Match comments - by Kevin - 01-29-2021, 04:26 AM
RE: Match comments - by macman - 01-29-2021, 05:44 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)