Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to write the sort result to the original file
#4
this should fix that

Code:
Copy      Help
int sep
str s=sub.getAutotextItem("At" sep)
ARRAY(str) a=s
a.sort(2)
s=a
;;code: Write the sort result to the original file
mac+ "At"
int h=GetQmCodeEditor
SendMessage(h SCI.SCI_GOTOLINE 1 0)
int ssp=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0)
SendMessage(h SCI.SCI_SETSEL ssp sep)
s.setclip
SendMessage(h SCI.SCI_PASTE 0 0)
#sub getAutotextItem
function~ ~name &sep
str pattern="(?m)^(.+\s\:.+)"
_s.getmacro(name 0);
ARRAY(CHARRANGE) a; int i
findrx(_s pattern 0 4 a)
str items t
for i 0 a.len
,int offset(a[0 i].cpMin) length(a[0 i].cpMax-a[0 i].cpMin)
,t.get(_s offset length)
,items.formata("%s[]" t.trim)
,sep=offset+length
ret items


Messages In This Thread
RE: How to write the sort result to the original file - by Kevin - 06-29-2019, 12:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)