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
#89
oh btw you have a few things that should be changed in your edit button code
 your code will only work if sub function name is sub.sub1 sub.sub2 ect ect ect . If you have a subfunction not named that wont find it and your list will be off.

also there is no need to use a global variable and especially not one that has a local name in another subfunction


here is updated code
 
Code:
Copy      Help
;case 14 ;;Edit
_s.getwintext(id(5 hDlg))
str ssss items=sub.gotoitemedit(_s)
items.replacerx("\Q:sub.\E|\;" "     ") 
_i=ListDialog(items "Which item to Edit" "Select item")
if(_i=0) ret
mac+ _s
int c=GetQmCodeEditor
SendMessage(c SCI.SCI_GOTOLINE _i 0)
ssss.getl(items _i-1)
ssss.trim
int ii=find(ssss "Sub." 0 1)
int cp=SendMessage(c SCI.SCI_GETCURRENTPOS 0 0)
cp+ii
SendMessage(c SCI.SCI_GOTOPOS cp 0)

#sub gotoitemedit
function~ ~name

str pattern="(?:.*\:sub\..*)"

_s.getmacro(name 0)
str ss d
int i
ARRAY(str) a
findrx(_s pattern 0 4 a)
for i 0 a.len
,d.formata("%s[]" a[0 i])

ret d.trim


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

Forum Jump:


Users browsing this thread: 1 Guest(s)