Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get a list of all AutoText files in the left pane
#67
@kevin

I found the function code to get the AutoText items.

Should be able to use this method to get sel_name and var_name



Function GetItems
Code:
Copy      Help
;get QM editor text

str s.getmacro; if(!s.len) ret

;find all '#sub Name' and ' $BkM optional name' lines
ARRAY(CHARRANGE) a; int i
if(0=findrx(s "(?m)^(?:#sub +(\w+)| \$BkM\b([^\r\n]*))" 0 4 a)) ret

;format items text for ListDialog
str items t
for i 0 a.len
,int isBM=s[a[0 i].cpMin]!='#'
,CHARRANGE& r=a[1+isBM i]
,int n=r.cpMax-r.cpMin; if(n>0) t.get(s r.cpMin n); t.trim; else t=""
,items.formata("%i %s[]" isBM t)

i=ListDialog(items "Subfunctions and code bookmarks" "Go to" 128|4 0 0 0 0 0 "$qm$\function.ico[]$qm$\favorites.ico")-1
out i
if(i<0) ret
int c=GetQmCodeEditor
SendMessage(c SCI.SCI_GOTOPOS a[0 i].cpMin 0)


Messages In This Thread
RE: How to get a list of all AutoText files in the left pane - by win - 04-17-2019, 12:36 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)