Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gets the text inside the subfunction
#12
1 more error correction

when cursor is in the last subfunction doesn't select all the code fixed below

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)
_s.getmacro
for _i line 0 -1
,str s.getl(_s _i)
,if(s.beg("#sub"))
,,break
int selLineStart=SendMessage(h SCI.SCI_POSITIONFROMLINE _i+1 0)
for int'i _i+1 numlines(_s)
,str ss.getl(_s i)
,if(ss.beg("#sub"))
,,break
,else
,,str ct.addline(ss -1)
out ct
if(i<>numlines(_s))
,i-1
int selLineEnd=SendMessage(h SCI.SCI_POSITIONFROMLINE i 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)


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, 05:17 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)