Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gets the text inside the subfunction
#8
Function Function2
Trigger Aq     Help - how to add the trigger to the macro
Code:
Copy      Help
out
int h=GetQmCodeEditor
int pos=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0)
int line=SendMessage(h SCI.SCI_LINEFROMPOSITION pos 0)
int selLineStart=SendMessage(h SCI.SCI_POSITIONFROMLINE line+1 0)
str ct
_s.getmacro
for int'i line+1 numlines(_s)
,str ss.getl(_s i)
,if(ss.beg("#sub"))
,,break
,else
,,ct.addline(ss -1)
out ct
int selLineEnd=SendMessage(h SCI.SCI_POSITIONFROMLINE i-1 0)
SendMessage(h SCI.SCI_SETSEL selLineStart selLineEnd)
int fpos=ct.findreplace("aa1" "aaaaaaaaaaaaaaaa1" 4)
if(fpos = -1)
,out "not found"
,end
SendMessage(h SCI.SCI_REPLACESEL 0 ct)

if you want to return cursor to original position add
 
Code:
Copy      Help
SendMessage(h SCI.SCI_GOTOPOS pos 0)
as the last line


Messages In This Thread
Gets the text inside the subfunction - by Davider - 11-27-2022, 03:12 AM
RE: Gets the text inside the subfunction - by Kevin - 12-01-2022, 03:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)